- java.lang.Object
- 
- javax.swing.plaf.ComponentUI
- 
- javax.swing.plaf.FileChooserUI
- 
- javax.swing.plaf.basic.BasicFileChooserUI
- 
- javax.swing.plaf.metal.MetalFileChooserUI
 
 
 
 
- 
 public class MetalFileChooserUI extends BasicFileChooserUI Metal L&F implementation of a FileChooser.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classMetalFileChooserUI.DirectoryComboBoxActionActs when DirectoryComboBox has changed the selected item.protected classMetalFileChooserUI.DirectoryComboBoxModelData model for a type-face selection combo-box.protected classMetalFileChooserUI.FileRendererDeprecated.As of JDK version 9.protected classMetalFileChooserUI.FilterComboBoxModelData model for a type-face selection combo-box.classMetalFileChooserUI.FilterComboBoxRendererRender different type sizes and styles.protected classMetalFileChooserUI.SingleClickListenerDeprecated.As of JDK version 9.- 
Nested classes/interfaces declared in class javax.swing.plaf.basic.BasicFileChooserUIBasicFileChooserUI.AcceptAllFileFilter, BasicFileChooserUI.ApproveSelectionAction, BasicFileChooserUI.BasicFileView, BasicFileChooserUI.CancelSelectionAction, BasicFileChooserUI.ChangeToParentDirectoryAction, BasicFileChooserUI.DoubleClickListener, BasicFileChooserUI.GoHomeAction, BasicFileChooserUI.NewFolderAction, BasicFileChooserUI.SelectionListener, BasicFileChooserUI.UpdateAction
 
- 
 - 
Field Summary- 
Fields declared in class javax.swing.plaf.basic.BasicFileChooserUIcancelButtonMnemonic, cancelButtonText, cancelButtonToolTipText, computerIcon, detailsViewIcon, directoryIcon, directoryOpenButtonMnemonic, directoryOpenButtonText, directoryOpenButtonToolTipText, fileIcon, floppyDriveIcon, hardDriveIcon, helpButtonMnemonic, helpButtonText, helpButtonToolTipText, homeFolderIcon, listViewIcon, newFolderIcon, openButtonMnemonic, openButtonText, openButtonToolTipText, saveButtonMnemonic, saveButtonText, saveButtonToolTipText, updateButtonMnemonic, updateButtonText, updateButtonToolTipText, upFolderIcon, viewMenuIcon
 
- 
 - 
Constructor SummaryConstructors Constructor Description MetalFileChooserUI(JFileChooser filechooser)Constructs a new instance ofMetalFileChooserUI.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddControlButtons()Adds control buttons to bottom panel.protected ActionMapcreateActionMap()Constructs an instance ofActionMap.protected JPanelcreateDetailsView(JFileChooser fc)Constructs a details view.protected MetalFileChooserUI.DirectoryComboBoxModelcreateDirectoryComboBoxModel(JFileChooser fc)Constructs a new instance ofDataModelforDirectoryComboBox.protected MetalFileChooserUI.FilterComboBoxModelcreateFilterComboBoxModel()Constructs aDataModelfor typesComboBox.protected MetalFileChooserUI.FilterComboBoxRenderercreateFilterComboBoxRenderer()Constructs aRendererfor typesComboBox.protected JPanelcreateList(JFileChooser fc)Constructs a details view.ListSelectionListenercreateListSelectionListener(JFileChooser fc)Creates a selection listener for the list of files and directories.static ComponentUIcreateUI(JComponent c)Constructs a new instance ofMetalFileChooserUI.protected ActionMapgetActionMap()Returns an instance ofActionMap.protected JPanelgetBottomPanel()Returns the bottom panel.protected JPanelgetButtonPanel()Returns the button panel.StringgetDirectoryName()Returns the directory name.DimensiongetMaximumSize(JComponent c)Returns the maximum size of theJFileChooser.DimensiongetMinimumSize(JComponent c)Returns the minimum size of theJFileChooser.DimensiongetPreferredSize(JComponent c)Returns the preferred size of the specifiedJFileChooser.protected voidremoveControlButtons()Removes control buttons from bottom panel.voidsetDirectoryName(String dirname)Sets the directory name.protected voidsetDirectorySelected(boolean directorySelected)Property to remember whether a directory is currently selected in the UI.voidvalueChanged(ListSelectionEvent e)Invokes whenListSelectionEventoccurs.- 
Methods declared in class javax.swing.plaf.basic.BasicFileChooserUIclearIconCache, createDoubleClickListener, createModel, createPropertyChangeListener, getAcceptAllFileFilter, getAccessoryPanel, getApproveButton, getApproveButtonMnemonic, getApproveButtonToolTipText, getApproveSelectionAction, getCancelSelectionAction, getChangeToParentDirectoryAction, getDialogTitle, getDirectory, getFileChooser, getFileName, getGoHomeAction, getModel, getNewFolderAction, getUpdateAction, installComponents, installDefaults, installIcons, installListeners, installStrings, installUI, isDirectorySelected, setDirectory, setFileName, uninstallComponents, uninstallDefaults, uninstallIcons, uninstallListeners, uninstallStrings, uninstallUI
 - 
Methods declared in class javax.swing.plaf.FileChooserUIensureFileIsVisible, getApproveButtonText, getDefaultButton, getFileView, rescanCurrentDirectory
 - 
Methods declared in class javax.swing.plaf.ComponentUIcontains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, paint, update
 
- 
 
- 
- 
- 
Constructor Detail- 
MetalFileChooserUIpublic MetalFileChooserUI(JFileChooser filechooser) Constructs a new instance ofMetalFileChooserUI.- Parameters:
- filechooser- a- JFileChooser
 
 
- 
 - 
Method Detail- 
createUIpublic static ComponentUI createUI(JComponent c) Constructs a new instance ofMetalFileChooserUI.- Parameters:
- c- a component
- Returns:
- a new instance of MetalFileChooserUI
 
 - 
getButtonPanelprotected JPanel getButtonPanel() Returns the button panel.- Returns:
- the button panel
 
 - 
getBottomPanelprotected JPanel getBottomPanel() Returns the bottom panel.- Returns:
- the bottom panel
 
 - 
getActionMapprotected ActionMap getActionMap() Returns an instance ofActionMap.- Returns:
- an instance of ActionMap
 
 - 
createActionMapprotected ActionMap createActionMap() Constructs an instance ofActionMap.- Returns:
- an instance of ActionMap
 
 - 
createListprotected JPanel createList(JFileChooser fc) Constructs a details view.- Parameters:
- fc- a- JFileChooser
- Returns:
- the list
 
 - 
createDetailsViewprotected JPanel createDetailsView(JFileChooser fc) Constructs a details view.- Parameters:
- fc- a- JFileChooser
- Returns:
- the details view
 
 - 
createListSelectionListenerpublic ListSelectionListener createListSelectionListener(JFileChooser fc) Creates a selection listener for the list of files and directories.- Overrides:
- createListSelectionListenerin class- BasicFileChooserUI
- Parameters:
- fc- a- JFileChooser
- Returns:
- a ListSelectionListener
 
 - 
getPreferredSizepublic Dimension getPreferredSize(JComponent c) Returns the preferred size of the specifiedJFileChooser. The preferred size is at least as large, in both height and width, as the preferred size recommended by the file chooser's layout manager.- Overrides:
- getPreferredSizein class- ComponentUI
- Parameters:
- c- a- JFileChooser
- Returns:
- a Dimensionspecifying the preferred width and height of the file chooser
- See Also:
- JComponent.getPreferredSize(),- LayoutManager.preferredLayoutSize(java.awt.Container)
 
 - 
getMinimumSizepublic Dimension getMinimumSize(JComponent c) Returns the minimum size of theJFileChooser.- Overrides:
- getMinimumSizein class- ComponentUI
- Parameters:
- c- a- JFileChooser
- Returns:
- a Dimensionspecifying the minimum width and height of the file chooser
- See Also:
- JComponent.getMinimumSize(),- LayoutManager.minimumLayoutSize(java.awt.Container),- ComponentUI.getPreferredSize(javax.swing.JComponent)
 
 - 
getMaximumSizepublic Dimension getMaximumSize(JComponent c) Returns the maximum size of theJFileChooser.- Overrides:
- getMaximumSizein class- ComponentUI
- Parameters:
- c- a- JFileChooser
- Returns:
- a Dimensionspecifying the maximum width and height of the file chooser
- See Also:
- JComponent.getMaximumSize(),- LayoutManager2.maximumLayoutSize(java.awt.Container)
 
 - 
removeControlButtonsprotected void removeControlButtons() Removes control buttons from bottom panel.
 - 
addControlButtonsprotected void addControlButtons() Adds control buttons to bottom panel.
 - 
setDirectorySelectedprotected void setDirectorySelected(boolean directorySelected) Property to remember whether a directory is currently selected in the UI. This is normally called by the UI on a selection event.- Overrides:
- setDirectorySelectedin class- BasicFileChooserUI
- Parameters:
- directorySelected- if a directory is currently selected.
- Since:
- 1.4
 
 - 
getDirectoryNamepublic String getDirectoryName() Returns the directory name.- Overrides:
- getDirectoryNamein class- BasicFileChooserUI
- Returns:
- the directory name
 
 - 
setDirectoryNamepublic void setDirectoryName(String dirname) Sets the directory name.- Overrides:
- setDirectoryNamein class- BasicFileChooserUI
- Parameters:
- dirname- the directory name
 
 - 
createDirectoryComboBoxModelprotected MetalFileChooserUI.DirectoryComboBoxModel createDirectoryComboBoxModel(JFileChooser fc) Constructs a new instance ofDataModelforDirectoryComboBox.- Parameters:
- fc- a- JFileChooser
- Returns:
- a new instance of DataModelforDirectoryComboBox
 
 - 
createFilterComboBoxRendererprotected MetalFileChooserUI.FilterComboBoxRenderer createFilterComboBoxRenderer() Constructs aRendererfor typesComboBox.- Returns:
- a Rendererfor typesComboBox
 
 - 
createFilterComboBoxModelprotected MetalFileChooserUI.FilterComboBoxModel createFilterComboBoxModel() Constructs aDataModelfor typesComboBox.- Returns:
- a DataModelfor typesComboBox
 
 - 
valueChangedpublic void valueChanged(ListSelectionEvent e) Invokes whenListSelectionEventoccurs.- Parameters:
- e- an instance of- ListSelectionEvent
 
 
- 
 
-