private void patchUI( JFileChooser fc ) {
		// turn top-right buttons into toolbar buttons
		Component topPanel = fc.getComponent( 0 );
		if( (topPanel instanceof JPanel) &&
			(((JPanel)topPanel).getLayout() instanceof BorderLayout) )
		{
			Component topButtonPanel = ((JPanel)topPanel).getComponent( 0 );
			if( (topButtonPanel instanceof JPanel) &&
				(((JPanel)topButtonPanel).getLayout() instanceof BoxLayout) )
			{
				Insets margin = UIManager.getInsets( "Button.margin" );
				Component[] comps = ((JPanel)topButtonPanel).getComponents();
				for( int i = comps.length - 1; i >= 0; i-- ) {
					Component c = comps[i];
					if( c instanceof JButton || c instanceof JToggleButton ) {
						AbstractButton b = (AbstractButton)c;
						b.putClientProperty( FlatClientProperties.BUTTON_TYPE,
							FlatClientProperties.BUTTON_TYPE_TOOLBAR_BUTTON );
						b.setMargin( margin );
						b.setFocusable( false );
					} else if( c instanceof Box.Filler )
						((JPanel)topButtonPanel).remove( i );
				}
			}
		}

		// increase maximum row count of directory combo box popup list
		try {
			Component directoryComboBox =  ((JPanel)topPanel).getComponent( 2 );
			if( directoryComboBox instanceof JComboBox ) {
				int maximumRowCount = UIManager.getInt( "ComboBox.maximumRowCount" );
				if( maximumRowCount > 0 )
					((JComboBox<?>)directoryComboBox).setMaximumRowCount( maximumRowCount );
			}
		} catch( ArrayIndexOutOfBoundsException ex ) {
			// ignore
		}

		// put north, center and south components into a new panel so that
		// the shortcuts panel (at west) gets full height
		LayoutManager layout = fc.getLayout();
		if( layout instanceof BorderLayout ) {
			BorderLayout borderLayout = (BorderLayout) layout;
			borderLayout.setHgap( 8 );

			Component north = borderLayout.getLayoutComponent( BorderLayout.NORTH );
			Component lineEnd = borderLayout.getLayoutComponent( BorderLayout.LINE_END );
			Component center = borderLayout.getLayoutComponent( BorderLayout.CENTER );
			Component south = borderLayout.getLayoutComponent( BorderLayout.SOUTH );
			if( north != null && lineEnd != null && center != null && south != null ) {
				JPanel p = new JPanel( new BorderLayout( 0, 11 ) );
				p.add( north, BorderLayout.NORTH );
				p.add( lineEnd, BorderLayout.LINE_END );
				p.add( center, BorderLayout.CENTER );
				p.add( south, BorderLayout.SOUTH );
				fc.add( p, BorderLayout.CENTER );
			}
		}
	}
Provides the Flat LaF UI delegate for {@link javax.swing.JFileChooser}.

<!-- BasicFileChooserUI -->

@uiDefault FileView.directoryIcon					Icon
@uiDefault FileView.fileIcon							Icon
@uiDefault FileView.computerIcon						Icon
@uiDefault FileView.hardDriveIcon					Icon
@uiDefault FileView.floppyDriveIcon					Icon

@uiDefault FileChooser.newFolderIcon					Icon
@uiDefault FileChooser.upFolderIcon					Icon
@uiDefault FileChooser.homeFolderIcon				Icon
@uiDefault FileChooser.detailsViewIcon				Icon
@uiDefault FileChooser.listViewIcon					Icon
@uiDefault FileChooser.viewMenuIcon					Icon

@uiDefault FileChooser.usesSingleFilePane			boolean
@uiDefault FileChooser.readOnly						boolean	if true, "New Folder" is disabled

@uiDefault FileChooser.newFolderErrorText					String
@uiDefault FileChooser.newFolderErrorSeparator				String
@uiDefault FileChooser.newFolderParentDoesntExistTitleText	String
@uiDefault FileChooser.newFolderParentDoesntExistText		String
@uiDefault FileChooser.fileDescriptionText					String
@uiDefault FileChooser.directoryDescriptionText				String
@uiDefault FileChooser.saveButtonText						String
@uiDefault FileChooser.openButtonText						String
@uiDefault FileChooser.saveDialogTitleText					String
@uiDefault FileChooser.openDialogTitleText					String
@uiDefault FileChooser.cancelButtonText						String
@uiDefault FileChooser.updateButtonText						String
@uiDefault FileChooser.helpButtonText						String
@uiDefault FileChooser.directoryOpenButtonText				String

@uiDefault FileChooser.saveButtonMnemonic					String
@uiDefault FileChooser.openButtonMnemonic					String
@uiDefault FileChooser.cancelButtonMnemonic					String
@uiDefault FileChooser.updateButtonMnemonic					String
@uiDefault FileChooser.helpButtonMnemonic					String
@uiDefault FileChooser.directoryOpenButtonMnemonic			String

@uiDefault FileChooser.saveButtonToolTipText					String
@uiDefault FileChooser.openButtonToolTipText					String
@uiDefault FileChooser.cancelButtonToolTipText				String
@uiDefault FileChooser.updateButtonToolTipText				String
@uiDefault FileChooser.helpButtonToolTipText					String
@uiDefault FileChooser.directoryOpenButtonToolTipText		String

@uiDefault FileChooser.acceptAllFileFilterText				String

<!-- MetalFileChooserUI -->

@uiDefault FileChooser.lookInLabelMnemonic					String
@uiDefault FileChooser.lookInLabelText						String
@uiDefault FileChooser.saveInLabelText						String
@uiDefault FileChooser.fileNameLabelMnemonic					String
@uiDefault FileChooser.fileNameLabelText						String
@uiDefault FileChooser.folderNameLabelMnemonic				String
@uiDefault FileChooser.folderNameLabelText					String
@uiDefault FileChooser.filesOfTypeLabelMnemonic				String
@uiDefault FileChooser.filesOfTypeLabelText					String

@uiDefault FileChooser.upFolderToolTipText					String
@uiDefault FileChooser.upFolderAccessibleName				String
@uiDefault FileChooser.homeFolderToolTipText					String
@uiDefault FileChooser.homeFolderAccessibleName				String
@uiDefault FileChooser.newFolderToolTipText					String
@uiDefault FileChooser.newFolderAccessibleName				String
@uiDefault FileChooser.listViewButtonToolTipText				String
@uiDefault FileChooser.listViewButtonAccessibleName			String
@uiDefault FileChooser.detailsViewButtonToolTipText			String
@uiDefault FileChooser.detailsViewButtonAccessibleName		String

<!-- FilePane -->

@uiDefault FileChooser.fileNameHeaderText					String
@uiDefault FileChooser.fileSizeHeaderText					String
@uiDefault FileChooser.fileTypeHeaderText					String
@uiDefault FileChooser.fileDateHeaderText					String
@uiDefault FileChooser.fileAttrHeaderText					String

@uiDefault FileChooser.viewMenuLabelText						String
@uiDefault FileChooser.refreshActionLabelText				String
@uiDefault FileChooser.newFolderActionLabelText				String
@uiDefault FileChooser.listViewActionLabelText				String
@uiDefault FileChooser.detailsViewActionLabelText			String

<!-- FlatFileChooserUI -->

@uiDefault FileChooser.shortcuts.buttonSize					Dimension	optional; default is 84,64
@uiDefault FileChooser.shortcuts.iconSize					Dimension	optional; default is 32,32
@uiDefault FileChooser.shortcuts.filesFunction				Function&lt;File[], File[]&gt;
@uiDefault FileChooser.shortcuts.displayNameFunction			Function&lt;File, String&gt;
@uiDefault FileChooser.shortcuts.iconFunction				Function&lt;File, Icon&gt;

@author Karl Tauber
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatFileChooserUI.java