private void layoutTabContainer( Component tabContainer ) {
			int tabPlacement = tabPane.getTabPlacement();
			Rectangle bounds = tabPane.getBounds();
			Insets insets = tabPane.getInsets();
			Insets contentInsets = getContentBorderInsets( tabPlacement );

			boolean horizontal = isHorizontalTabPlacement( tabPlacement );
			int tabAreaWidth = !horizontal ? calculateTabAreaWidth( tabPlacement, runCount, maxTabWidth ) : 0;
			int tabAreaHeight = horizontal ? calculateTabAreaHeight( tabPlacement, runCount, maxTabHeight ) : 0;
			int w = (tabAreaWidth != 0)
				? tabAreaWidth + insets.left + insets.right + contentInsets.left + contentInsets.right
				: bounds.width;
			int h = (tabAreaHeight != 0)
				? tabAreaHeight + insets.top + insets.bottom + contentInsets.top + contentInsets.bottom
				: bounds.height;

			int x = (tabPlacement == RIGHT) ? bounds.width - w : 0;
			int y = (tabPlacement == BOTTOM) ? bounds.height - h : 0;

			tabContainer.setBounds( x, y, w, h );

			// layout tab components in tab container
			layoutTabComponents( tabContainer );
		}
Layouts container used for custom components in tabs.
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTabbedPaneUI.java