@SuppressWarnings( "rawtypes" )
	@Override
	protected void paintCell( Graphics g, int row, Rectangle rowBounds, ListCellRenderer cellRenderer,
		ListModel dataModel, ListSelectionModel selModel, int leadIndex )
	{
		boolean isSelected = selModel.isSelectedIndex( row );

		// paint alternating rows
		if( alternateRowColor != null && row % 2 != 0 &&
			!"ComboBox.list".equals( list.getName() ) ) // combobox does not support alternate row color
		{
			g.setColor( alternateRowColor );

			float arc = UIScale.scale( selectionArc / 2f );
			FlatUIUtils.paintSelection( (Graphics2D) g, rowBounds.x, rowBounds.y, rowBounds.width, rowBounds.height,
				UIScale.scale( selectionInsets ), arc, arc, arc, arc, 0 );
		}

		// get renderer component
		@SuppressWarnings( "unchecked" )
		Component rendererComponent = cellRenderer.getListCellRendererComponent( list,
			dataModel.getElementAt( row ), row, isSelected,
			FlatUIUtils.isPermanentFocusOwner( list ) && (row == leadIndex) );

		// use smaller cell width if list is used in JFileChooser
		boolean isFileList = Boolean.TRUE.equals( list.getClientProperty( "List.isFileList" ) );
		int cx, cw;
		if( isFileList ) {
			// see BasicListUI.paintCell()
			cw = Math.min( rowBounds.width, rendererComponent.getPreferredSize().width + 4 );
			cx = list.getComponentOrientation().isLeftToRight()
				? rowBounds.x
				: rowBounds.x + (rowBounds.width - cw);
		} else {
			cx = rowBounds.x;
			cw = rowBounds.width;
		}

		// rounded selection or selection insets
		if( isSelected &&
			!isFileList && // rounded selection is not supported for file list
			(rendererComponent instanceof DefaultListCellRenderer ||
			 rendererComponent instanceof BasicComboBoxRenderer) &&
			(selectionArc > 0 ||
			 (selectionInsets != null && !FlatUIUtils.isInsetsEmpty( selectionInsets ))) )
		{
			// Because selection painting is done in the cell renderer, it would be
			// necessary to require a FlatLaf specific renderer to implement rounded selection.
			// Using a LaF specific renderer was avoided because often a custom renderer is
			// already used in applications. Then either the rounded selection is not used,
			// or the application has to be changed to extend a FlatLaf renderer.
			//
			// To solve this, a graphics proxy is used that paints rounded selection
			// if row is selected and the renderer wants to fill the background.
			class RoundedSelectionGraphics extends Graphics2DProxy {
				// used to avoid endless loop in case that paintCellSelection() invokes
				// g.fillRect() with full bounds (selectionInsets is 0,0,0,0)
				private boolean inPaintSelection;

				RoundedSelectionGraphics( Graphics delegate ) {
					super( (Graphics2D) delegate );
				}

				@Override
				public Graphics create() {
					return new RoundedSelectionGraphics( super.create() );
				}

				@Override
				public Graphics create( int x, int y, int width, int height ) {
					return new RoundedSelectionGraphics( super.create( x, y, width, height ) );
				}

				@Override
				public void fillRect( int x, int y, int width, int height ) {
					if( !inPaintSelection &&
						x == 0 && y == 0 && width == rowBounds.width && height == rowBounds.height &&
						this.getColor() == rendererComponent.getBackground() )
					{
						inPaintSelection = true;
						paintCellSelection( this, row, x, y, width, height );
						inPaintSelection = false;
					} else
						super.fillRect( x, y, width, height );
				}
			}
			g = new RoundedSelectionGraphics( g );
		}

		// paint renderer
		rendererPane.paintComponent( g, rendererComponent, list, cx, rowBounds.y, cw, rowBounds.height, true );
	}
Toggle selection colors from focused to inactive and vice versa.

This is not an optimal solution but much easier than rewriting the whole paint methods.

Using a LaF specific renderer was avoided because often a custom renderer is
already used in applications. Then either the inactive colors are not used,
or the application has to be changed to extend a FlatLaf renderer.
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatListUI.java