@Override
	public void paint( Graphics g, JComponent c ) {
		if( hideTabArea() )
			return;

		ensureCurrentLayout();

		int tabPlacement = tabPane.getTabPlacement();
		int selectedIndex = tabPane.getSelectedIndex();

		paintContentBorder( g, tabPlacement, selectedIndex );

		// fill tabs area background
		// - for rounded cards use partly rounded rectangle
		if( tabsOpaque && !tabPane.isOpaque() && tabPane.getTabCount() > 0 ) {
			Rectangle tr = null;
			if( isScrollTabLayout() ) {
				// scroll layout: use tab viewport bounds and add visible buttons
				tr = tabViewport.getBounds();
				for( Component child : tabPane.getComponents() ) {
					if( child instanceof FlatTabAreaButton && child.isVisible() )
						tr = tr.union( child.getBounds() );
				}
			} else {
				// wrap layout: use union of all tab rectangles
				for( Rectangle r : rects )
					tr = (tr != null) ? tr.union( r ) : r;
			}

			if( tr != null ) {
				g.setColor( tabPane.getBackground() );

				if( (getTabType() == TAB_TYPE_CARD) && cardTabArc > 0 ) {
					((Graphics2D)g).fill( createCardTabOuterPath( tabPlacement, tr.x, tr.y, tr.width, tr.height ) );
				} else
					g.fillRect( tr.x, tr.y, tr.width, tr.height );
			}
		}

		if( !isScrollTabLayout() )
			paintTabArea( g, tabPlacement, selectedIndex );
	}
The content border insets are used to create a separator between tabs and content.
If client property JTabbedPane.hasFullBorder is true, then the content border insets
are also used for the border.
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTabbedPaneUI.java