Rectangle layoutLeftAndRightComponents( Rectangle tr, int tabAreaAlignment, Insets tabAreaInsets,
			boolean useTabAreaAlignment, boolean shiftTabs, boolean leftToRight )
		{
			int leadingWidth = getLeadingPreferredWidth();
			int trailingWidth = getTrailingPreferredWidth();

			// apply tab area alignment
			if( useTabAreaAlignment && rects.length > 0 ) {
				int availWidth = tr.width - leadingWidth - trailingWidth - tabAreaInsets.left - tabAreaInsets.right;
				int totalTabWidth = rectsTotalWidth( leftToRight );
				int diff = availWidth - totalTabWidth;

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

					case TRAILING:
						if( shiftTabs )
							shiftTabs( leftToRight ? diff : -diff, 0 );
						leadingWidth += diff;
						break;

					case CENTER:
						if( shiftTabs )
							shiftTabs( (leftToRight ? diff : -diff) / 2, 0 );
						leadingWidth += diff / 2;
						trailingWidth += diff - (diff / 2);
						break;

					case FILL:
						stretchTabsWidth( diff, leftToRight );
						break;
				}
			} else if( rects.length == 0 )
				trailingWidth = tr.width - leadingWidth;

			// layout left component
			Container leftComponent = leftToRight ? leadingComponent : trailingComponent;
			int leftWidth = leftToRight ? leadingWidth : trailingWidth;
			if( leftComponent != null )
				leftComponent.setBounds( tr.x, tr.y, leftWidth, tr.height );

			// layout right component
			Container rightComponent = leftToRight ? trailingComponent : leadingComponent;
			int rightWidth = leftToRight ? trailingWidth : leadingWidth;
			if( rightComponent != null )
				rightComponent.setBounds( tr.x + tr.width - rightWidth, tr.y, rightWidth, tr.height );

			// return new tab area bounds reduced by left/right components and applied tab area alignment
			Rectangle r = new Rectangle( tr );
			r.x += leftWidth;
			r.width -= leftWidth + rightWidth;
			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