Rectangle layoutTopAndBottomComponents( Rectangle tr, int tabAreaAlignment, Insets tabAreaInsets,
			boolean useTabAreaAlignment, boolean shiftTabs )
		{
			int topHeight = getLeadingPreferredHeight();
			int bottomHeight = getTrailingPreferredHeight();

			// apply tab area alignment
			if( useTabAreaAlignment && rects.length > 0 ) {
				int availHeight = tr.height - topHeight - bottomHeight - tabAreaInsets.top - tabAreaInsets.bottom;
				int totalTabHeight = rectsTotalHeight();
				int diff = availHeight - totalTabHeight;

				switch( tabAreaAlignment ) {
					case LEADING:
						bottomHeight += diff;
						break;

					case TRAILING:
						if( shiftTabs )
							shiftTabs( 0, diff );
						topHeight += diff;
						break;

					case CENTER:
						if( shiftTabs )
							shiftTabs( 0, diff / 2 );
						topHeight += diff / 2;
						bottomHeight += diff - (diff / 2);
						break;

					case FILL:
						stretchTabsHeight( diff );
						break;
				}
			} else if( rects.length == 0 )
				bottomHeight = tr.height - topHeight;

			// layout top component
			if( leadingComponent != null )
				leadingComponent.setBounds( tr.x, tr.y, tr.width, topHeight );

			// layout bottom component
			if( trailingComponent != null )
				trailingComponent.setBounds( tr.x, tr.y + tr.height - bottomHeight, tr.width, bottomHeight );

			// return new tab area bounds reduced by top/bottom components and applied tab area alignment
			Rectangle r = new Rectangle( tr );
			r.y += topHeight;
			r.height -= topHeight + bottomHeight;
			return r;
		}
Returns bounds for leading/trailing components and tab area.

Note: Returns bounds for first tabs row only.
For multi-rows tabs in wrap mode, the returned bounds does not include full tab area.
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTabbedPaneUI.java