public class JFileChooser extends JComponent implements javax.accessibility.Accessible
FileFilter instance using
addChoosableFileFilter(FileFilter). Additional components can
be embedded in the file chooser using setAccessory(JComponent).
The JFileChooser properties also provide mechanisms to customize the
behaviour of the file chooser.| Modifier and Type | Class and Description |
|---|---|
protected class |
JFileChooser.AccessibleJFileChooser
Provides the accessibility features for the
JFileChooser
component. |
JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY
The name of the 'accept all file filter used' property.
|
protected javax.accessibility.AccessibleContext |
accessibleContext
The accessible context.
|
static java.lang.String |
ACCESSORY_CHANGED_PROPERTY
The name of the 'accessory' property.
|
static java.lang.String |
APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY
The name of the property for the approve button mnemonic.
|
static java.lang.String |
APPROVE_BUTTON_TEXT_CHANGED_PROPERTY
The name of the property for the approve button text.
|
static java.lang.String |
APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY
The name of the property for the approve button tool tip text.
|
static int |
APPROVE_OPTION
A return value indicating the file chooser has been closed by approving
the selection.
|
static java.lang.String |
APPROVE_SELECTION
Action command string for approving the current selection.
|
static int |
CANCEL_OPTION
A return value indicating the file chooser has been closed by cancelling.
|
static java.lang.String |
CANCEL_SELECTION
Action command string for cancelling the current selection.
|
static java.lang.String |
CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY
The name of the 'choosable file filters' property.
|
static java.lang.String |
CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY
The name of the property for control button visibility.
|
static int |
CUSTOM_DIALOG
A dialog type for some custom purpose.
|
static java.lang.String |
DIALOG_TITLE_CHANGED_PROPERTY
The name of the 'dialog title' property.
|
static java.lang.String |
DIALOG_TYPE_CHANGED_PROPERTY
The name of the 'dialog type' property.
|
static int |
DIRECTORIES_ONLY
A selection mode constant indicating acceptance of directories only.
|
static java.lang.String |
DIRECTORY_CHANGED_PROPERTY
The name of the property for the current directory.
|
static int |
ERROR_OPTION
A return value indicating the file chooser has been closed by some error.
|
static java.lang.String |
FILE_FILTER_CHANGED_PROPERTY
The name of the 'file filter' property.
|
static java.lang.String |
FILE_HIDING_CHANGED_PROPERTY
The name of the 'file hiding enabled' property.
|
static java.lang.String |
FILE_SELECTION_MODE_CHANGED_PROPERTY
The name of the 'file selection mode' property.
|
static java.lang.String |
FILE_SYSTEM_VIEW_CHANGED_PROPERTY
The name of the 'file system view' property.
|
static java.lang.String |
FILE_VIEW_CHANGED_PROPERTY
The name of the 'file view' property.
|
static int |
FILES_AND_DIRECTORIES
A selection mode constant indicating acceptance of files and directories.
|
static int |
FILES_ONLY
A selection mode constant indicating acceptance of files only.
|
static java.lang.String |
MULTI_SELECTION_ENABLED_CHANGED_PROPERTY
The name of the property for multi-selection.
|
static int |
OPEN_DIALOG
A dialog type for selecting a file to open.
|
static int |
SAVE_DIALOG
A dialog type for selecting a file to save.
|
static java.lang.String |
SELECTED_FILE_CHANGED_PROPERTY
The name of the property for the selected file.
|
static java.lang.String |
SELECTED_FILES_CHANGED_PROPERTY
The name of the property for the selected files.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
JFileChooser()
Creates a new
JFileChooser object. |
JFileChooser(java.io.File currentDirectory)
Creates a new
JFileChooser object. |
JFileChooser(java.io.File currentDirectory,
javax.swing.filechooser.FileSystemView fsv)
Creates a new
JFileChooser object. |
JFileChooser(javax.swing.filechooser.FileSystemView fsv)
Creates a new
JFileChooser object. |
JFileChooser(java.lang.String currentDirectoryPath)
Creates a new
JFileChooser object. |
JFileChooser(java.lang.String currentDirectoryPath,
javax.swing.filechooser.FileSystemView fsv)
Creates a new
JFileChooser object with the specified
directory and FileSystemView. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(java.io.File f)
Returns
true if the file is accepted by the current
file filter. |
void |
addActionListener(java.awt.event.ActionListener l)
Adds an
ActionListener to the file chooser. |
void |
addChoosableFileFilter(javax.swing.filechooser.FileFilter filter)
Adds a file filter to the list of available filters and sends a
PropertyChangeEvent (with the property name
CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) to all registered
listeners. |
void |
approveSelection()
Approves the selection.
|
void |
cancelSelection()
Cancels the selection.
|
void |
changeToParentDirectory()
Called by the UI delegate when the parent directory is changed.
|
protected JDialog |
createDialog(java.awt.Component parent)
Creates a modal dialog in which to display the file chooser.
|
void |
ensureFileIsVisible(java.io.File f)
Ensures the the specified file is visible (this is handled by the
UI delegate).
|
protected void |
fireActionPerformed(java.lang.String command)
Sends an @link {ActionEvent} to all registered listeners.
|
javax.swing.filechooser.FileFilter |
getAcceptAllFileFilter()
Returns the 'accept all' file filter from the UI delegate.
|
javax.accessibility.AccessibleContext |
getAccessibleContext()
Returns the object that provides accessibility features for this
JFileChooser component. |
JComponent |
getAccessory()
Returns the accessory component for the file chooser.
|
java.awt.event.ActionListener[] |
getActionListeners()
Returns the action listeners registered with this file chooser.
|
int |
getApproveButtonMnemonic()
Returns the approve button mnemonic, or zero if no mnemonic has been set.
|
java.lang.String |
getApproveButtonText()
Returns the approve button text.
|
java.lang.String |
getApproveButtonToolTipText()
Returns the tool tip text for the approve button.
|
javax.swing.filechooser.FileFilter[] |
getChoosableFileFilters()
Returns the available file filters for this file chooser.
|
boolean |
getControlButtonsAreShown()
Returns the flag that controls whether or not the control buttons are
shown on the file chooser.
|
java.io.File |
getCurrentDirectory()
Returns the current directory.
|
java.lang.String |
getDescription(java.io.File f)
Returns the description of the file, generated by the current (or default)
FileView. |
java.lang.String |
getDialogTitle()
Returns the dialog title.
|
int |
getDialogType()
Returns the type of file chooser.
|
boolean |
getDragEnabled()
Returns true if dragging is enabled.
|
javax.swing.filechooser.FileFilter |
getFileFilter()
Returns the file filter.
|
int |
getFileSelectionMode()
|
javax.swing.filechooser.FileSystemView |
getFileSystemView()
Returns the file system view being used by this file chooser.
|
javax.swing.filechooser.FileView |
getFileView()
Returns the custom
FileView for the file chooser. |
Icon |
getIcon(java.io.File f)
Returns the icon provided by the current (or default)
FileView. |
java.lang.String |
getName(java.io.File f)
Returns the name of the file, generated by the current (or default)
FileView. |
java.io.File |
getSelectedFile()
Returns the selected file, if there is one.
|
java.io.File[] |
getSelectedFiles()
Returns the selected file or files in an array.
|
java.lang.String |
getTypeDescription(java.io.File f)
Returns the type description for the file, generated by the current (or
default)
FileView. |
javax.swing.plaf.FileChooserUI |
getUI()
Returns the UI delegate for the component.
|
java.lang.String |
getUIClassID()
Returns the UI delegate class identifier.
|
boolean |
isAcceptAllFileFilterUsed()
Returns the flag that controls whether or not the 'accept all' file
filter is included in the list of filters.
|
boolean |
isDirectorySelectionEnabled()
Returns
true if directory selection is enabled, and
false otherwise. |
boolean |
isFileHidingEnabled()
Returns
true if hidden files are to be hidden, and
false otherwise. |
boolean |
isFileSelectionEnabled()
Returns
true if file selection is enabled, and
false otherwise. |
boolean |
isMultiSelectionEnabled()
Returns
true if multiple selections are allowed within this
file chooser, and false otherwise. |
boolean |
isTraversable(java.io.File f)
Returns
true if the file is traversable, and
false otherwise. |
protected java.lang.String |
paramString()
Returns a string describing the attributes for the
JFileChooser component, for use in debugging. |
void |
removeActionListener(java.awt.event.ActionListener l)
Removes an
ActionListener from this file chooser. |
boolean |
removeChoosableFileFilter(javax.swing.filechooser.FileFilter f)
Removes a file filter from the list of available filters and sends a
PropertyChangeEvent (with the property name
CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) to all registered
listeners. |
void |
rescanCurrentDirectory()
Rescans the current directory (this is handled by the UI delegate).
|
void |
resetChoosableFileFilters()
Clears the list of choosable file filters and installs the 'accept all'
filter from the UI delegate.
|
void |
setAcceptAllFileFilterUsed(boolean b)
Sets the flag that controls whether or not the 'accept all' file filter
is included in the list of filters, and sends a
PropertyChangeEvent (with the property name
ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY) to all registered
listeners. |
void |
setAccessory(JComponent newAccessory)
Sets the accessory component for the file chooser and sends a
PropertyChangeEvent to all registered listeners. |
void |
setApproveButtonMnemonic(char mnemonic)
Sets the mnemonic for the approve button and sends a
PropertyChangeEvent (with the property name
APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY) to all registered
listeners. |
void |
setApproveButtonMnemonic(int mnemonic)
Sets the mnemonic for the approve button and sends a
PropertyChangeEvent (with the property name
APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY) to all registered
listeners. |
void |
setApproveButtonText(java.lang.String approveButtonText)
Sets the approve button text and fires a
PropertyChangeEvent
(with the property name APPROVE_BUTTON_TEXT_CHANGED_PROPERTY) to
all registered listeners. |
void |
setApproveButtonToolTipText(java.lang.String toolTipText)
Sets the tool tip text for the approve button and sends a
PropertyChangeEvent (with the property name
APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY) to all
registered listeners. |
void |
setControlButtonsAreShown(boolean b)
Sets the flag that controls whether or not the control buttons are
shown and, if it changes, sends a
PropertyChangeEvent (with the
property name CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY) to
all registered listeners. |
void |
setCurrentDirectory(java.io.File dir)
Sets the current directory and fires a
PropertyChangeEvent (with
the property name DIRECTORY_CHANGED_PROPERTY) to all registered
listeners. |
void |
setDialogTitle(java.lang.String dialogTitle)
Sets the dialog title and sends a
PropertyChangeEvent (with the
property name DIALOG_TITLE_CHANGED_PROPERTY) to all
registered listeners. |
void |
setDialogType(int dialogType)
Sets the dialog type and fires a
PropertyChangeEvent (with the
property name DIALOG_TYPE_CHANGED_PROPERTY) to all
registered listeners. |
void |
setDragEnabled(boolean b)
Sets the dragEnabled property, this disables/enables automatic drag
handling (drag and drop) on this component.
|
void |
setFileFilter(javax.swing.filechooser.FileFilter filter)
Sets the file filter and sends a
PropertyChangeEvent (with the
property name FILE_FILTER_CHANGED_PROPERTY) to all registered
listeners. |
void |
setFileHidingEnabled(boolean b)
Sets the flag that controls whether or not hidden files are displayed,
and sends a
PropertyChangeEvent (with the property name
FILE_HIDING_CHANGED_PROPERTY) to all registered listeners. |
void |
setFileSelectionMode(int mode)
Sets the file selection mode and sends a
PropertyChangeEvent
to all registered listeners. |
void |
setFileSystemView(javax.swing.filechooser.FileSystemView fsv)
Sets the file system view for the file chooser and sends a
PropertyChangeEvent to all registered listeners. |
void |
setFileView(javax.swing.filechooser.FileView fileView)
Sets a custom
FileView for the file chooser and sends a
PropertyChangeEvent to all registered listeners. |
void |
setMultiSelectionEnabled(boolean b)
Sets the flag that controls whether multiple selections are allowed in
this filechooser and sends a
PropertyChangeEvent (with the
property name MULTI_SELECTION_ENABLED_CHANGED_PROPERTY) to all
registered listeners. |
void |
setSelectedFile(java.io.File file)
Sets the selected file and sends a
PropertyChangeEvent to all
registered listeners. |
void |
setSelectedFiles(java.io.File[] selectedFiles)
Sets the selected files and sends a
PropertyChangeEvent (with the
name SELECTED_FILES_CHANGED_PROPERTY) to all registered
listeners. |
protected void |
setup(javax.swing.filechooser.FileSystemView view)
Sets up the file chooser.
|
int |
showDialog(java.awt.Component parent,
java.lang.String approveButtonText)
Displays the file chooser in a modal dialog using the
CUSTOM_DIALOG type. |
int |
showOpenDialog(java.awt.Component parent)
Displays the file chooser in a modal dialog using the
OPEN_DIALOG type. |
int |
showSaveDialog(java.awt.Component parent)
Displays the file chooser in a modal dialog using the
SAVE_DIALOG type. |
void |
updateUI()
Installs the UI delegate for the current look and feel.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final int OPEN_DIALOG
setDialogType(int),
Constant Field Valuespublic static final int SAVE_DIALOG
setDialogType(int),
Constant Field Valuespublic static final int CUSTOM_DIALOG
setDialogType(int),
Constant Field Valuespublic static final int CANCEL_OPTION
public static final int APPROVE_OPTION
public static final int ERROR_OPTION
public static final int FILES_ONLY
public static final int DIRECTORIES_ONLY
public static final int FILES_AND_DIRECTORIES
public static final java.lang.String CANCEL_SELECTION
cancelSelection(),
Constant Field Valuespublic static final java.lang.String APPROVE_SELECTION
cancelSelection(),
Constant Field Valuespublic static final java.lang.String APPROVE_BUTTON_TEXT_CHANGED_PROPERTY
public static final java.lang.String APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY
public static final java.lang.String APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY
public static final java.lang.String CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY
public static final java.lang.String DIRECTORY_CHANGED_PROPERTY
public static final java.lang.String SELECTED_FILE_CHANGED_PROPERTY
setSelectedFile(File),
Constant Field Valuespublic static final java.lang.String SELECTED_FILES_CHANGED_PROPERTY
public static final java.lang.String MULTI_SELECTION_ENABLED_CHANGED_PROPERTY
public static final java.lang.String FILE_SYSTEM_VIEW_CHANGED_PROPERTY
public static final java.lang.String FILE_VIEW_CHANGED_PROPERTY
setFileView(FileView),
Constant Field Valuespublic static final java.lang.String FILE_HIDING_CHANGED_PROPERTY
public static final java.lang.String FILE_FILTER_CHANGED_PROPERTY
public static final java.lang.String FILE_SELECTION_MODE_CHANGED_PROPERTY
public static final java.lang.String ACCESSORY_CHANGED_PROPERTY
public static final java.lang.String ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY
public static final java.lang.String DIALOG_TITLE_CHANGED_PROPERTY
setDialogTitle(String),
Constant Field Valuespublic static final java.lang.String DIALOG_TYPE_CHANGED_PROPERTY
setDialogType(int),
Constant Field Valuespublic static final java.lang.String CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY
protected javax.accessibility.AccessibleContext accessibleContext
getAccessibleContext()public JFileChooser()
JFileChooser object.public JFileChooser(java.lang.String currentDirectoryPath)
JFileChooser object.currentDirectoryPath - the directory that should initially be
shown in the filechooser (if null, the user's home
directory is used).public JFileChooser(java.lang.String currentDirectoryPath, javax.swing.filechooser.FileSystemView fsv)
JFileChooser object with the specified
directory and FileSystemView.currentDirectoryPath - the directory that should initially be
shown in the filechooser (if null, the user's home
directory is used).fsv - the file system view (if null, the default file
system view is used).public JFileChooser(java.io.File currentDirectory)
JFileChooser object.currentDirectory - the directory that should initially be
shown in the filechooser (if null, the user's home
directory is used).public JFileChooser(javax.swing.filechooser.FileSystemView fsv)
JFileChooser object.fsv - the file system view (if null, the default file
system view is used).public JFileChooser(java.io.File currentDirectory, javax.swing.filechooser.FileSystemView fsv)
JFileChooser object.currentDirectory - the directory that should initially be
shown in the filechooser (if null, the user's home
directory is used).fsv - the file system view (if null, the default file
system view is used).protected void setup(javax.swing.filechooser.FileSystemView view)
view - the file system view (if null, the default file
system view is used).FileSystemView.getFileSystemView()public void setDragEnabled(boolean b)
b - - the new dragEnabled valuepublic boolean getDragEnabled()
public java.io.File getSelectedFile()
null).setSelectedFile(File)public void setSelectedFile(java.io.File file)
PropertyChangeEvent to all
registered listeners. The property name is
SELECTED_FILE_CHANGED_PROPERTY.file - the file (null permitted).public java.io.File[] getSelectedFiles()
public void setSelectedFiles(java.io.File[] selectedFiles)
PropertyChangeEvent (with the
name SELECTED_FILES_CHANGED_PROPERTY) to all registered
listeners.selectedFiles - the selected files (null permitted).public java.io.File getCurrentDirectory()
public void setCurrentDirectory(java.io.File dir)
PropertyChangeEvent (with
the property name DIRECTORY_CHANGED_PROPERTY) to all registered
listeners. If dir is null, the current
directory is set to the default directory returned by the file system
view.dir - the new directory (null permitted).FileSystemView.getDefaultDirectory()public void changeToParentDirectory()
public void rescanCurrentDirectory()
public void ensureFileIsVisible(java.io.File f)
f - the file.public int showOpenDialog(java.awt.Component parent) throws java.awt.HeadlessException
OPEN_DIALOG type.parent - the parent component.APPROVE_OPTION, CANCEL_OPTION and
ERROR_OPTION).java.awt.HeadlessException - DOCUMENT ME!public int showSaveDialog(java.awt.Component parent) throws java.awt.HeadlessException
SAVE_DIALOG type.parent - the parent component.APPROVE_OPTION, CANCEL_OPTION and
ERROR_OPTION).java.awt.HeadlessException - DOCUMENT ME!public int showDialog(java.awt.Component parent, java.lang.String approveButtonText) throws java.awt.HeadlessException
CUSTOM_DIALOG type.parent - the parent component.APPROVE_OPTION, CANCEL_OPTION and
ERROR_OPTION).java.awt.HeadlessException - DOCUMENT ME!protected JDialog createDialog(java.awt.Component parent) throws java.awt.HeadlessException
parent - the parent component.java.awt.HeadlessException - DOCUMENT ME!public boolean getControlButtonsAreShown()
setControlButtonsAreShown(boolean)public void setControlButtonsAreShown(boolean b)
PropertyChangeEvent (with the
property name CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY) to
all registered listeners.b - the new value for the flag.public int getDialogType()
OPEN_DIALOG, SAVE_DIALOG or
CUSTOM_DIALOG.setDialogType(int)public void setDialogType(int dialogType)
PropertyChangeEvent (with the
property name DIALOG_TYPE_CHANGED_PROPERTY) to all
registered listeners.dialogType - the dialog type (one of: OPEN_DIALOG,
SAVE_DIALOG, CUSTOM_DIALOG).java.lang.IllegalArgumentException - if dialogType is not valid.public void setDialogTitle(java.lang.String dialogTitle)
PropertyChangeEvent (with the
property name DIALOG_TITLE_CHANGED_PROPERTY) to all
registered listeners.dialogTitle - the dialog title (null permitted).getDialogTitle()public java.lang.String getDialogTitle()
null).setDialogTitle(String)public void setApproveButtonToolTipText(java.lang.String toolTipText)
PropertyChangeEvent (with the property name
APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY) to all
registered listeners.toolTipText - the text.public java.lang.String getApproveButtonToolTipText()
setApproveButtonToolTipText(String)public int getApproveButtonMnemonic()
setApproveButtonMnemonic(int)public void setApproveButtonMnemonic(int mnemonic)
PropertyChangeEvent (with the property name
APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY) to all registered
listeners.mnemonic - the mnemonic.setApproveButtonMnemonic(char)public void setApproveButtonMnemonic(char mnemonic)
PropertyChangeEvent (with the property name
APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY) to all registered
listeners.mnemonic - the mnemonic.setApproveButtonMnemonic(int)public void setApproveButtonText(java.lang.String approveButtonText)
PropertyChangeEvent
(with the property name APPROVE_BUTTON_TEXT_CHANGED_PROPERTY) to
all registered listeners.approveButtonText - the text (null permitted).getApproveButtonText()public java.lang.String getApproveButtonText()
null).setApproveButtonText(String)public javax.swing.filechooser.FileFilter[] getChoosableFileFilters()
public void addChoosableFileFilter(javax.swing.filechooser.FileFilter filter)
PropertyChangeEvent (with the property name
CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) to all registered
listeners.filter - the filter (null permitted).public boolean removeChoosableFileFilter(javax.swing.filechooser.FileFilter f)
PropertyChangeEvent (with the property name
CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) to all registered
listeners.f - the file filter.true if the filter was removed and
false otherwise.public void resetChoosableFileFilters()
public javax.swing.filechooser.FileFilter getAcceptAllFileFilter()
public boolean isAcceptAllFileFilterUsed()
setAcceptAllFileFilterUsed(boolean)public void setAcceptAllFileFilterUsed(boolean b)
PropertyChangeEvent (with the property name
ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY) to all registered
listeners.b - the new value of the flag.public JComponent getAccessory()
null.null).setAccessory(JComponent)public void setAccessory(JComponent newAccessory)
PropertyChangeEvent to all registered listeners. The property
name is ACCESSORY_CHANGED_PROPERTY.newAccessory - the accessory component.public void setFileSelectionMode(int mode)
PropertyChangeEvent
to all registered listeners. The property name is
FILE_SELECTION_MODE_CHANGED_PROPERTY.mode - the mode (FILES_ONLY, DIRECTORIES_ONLY or
FILES_AND_DIRECTORIES).java.lang.IllegalArgumentException - if the mode is invalid.public int getFileSelectionMode()
FILES_ONLY,
DIRECTORIES_ONLY or FILES_AND_DIRECTORIES. The
default is FILES_ONLY.setFileSelectionMode(int)public boolean isFileSelectionEnabled()
true if file selection is enabled, and
false otherwise. File selection is enabled when the
file selection mode is FILES_ONLY or
FILES_AND_DIRECTORIES.true if file selection is enabled.getFileSelectionMode()public boolean isDirectorySelectionEnabled()
true if directory selection is enabled, and
false otherwise. Directory selection is enabled when the
file selection mode is DIRECTORIES_ONLY or
FILES_AND_DIRECTORIES.true if file selection is enabled.getFileSelectionMode()public void setMultiSelectionEnabled(boolean b)
PropertyChangeEvent (with the
property name MULTI_SELECTION_ENABLED_CHANGED_PROPERTY) to all
registered listeners.b - the new value of the flag.public boolean isMultiSelectionEnabled()
true if multiple selections are allowed within this
file chooser, and false otherwise.setMultiSelectionEnabled(boolean)public boolean isFileHidingEnabled()
true if hidden files are to be hidden, and
false otherwise.setFileHidingEnabled(boolean)public void setFileHidingEnabled(boolean b)
PropertyChangeEvent (with the property name
FILE_HIDING_CHANGED_PROPERTY) to all registered listeners.b - the new value of the flag.public void setFileFilter(javax.swing.filechooser.FileFilter filter)
PropertyChangeEvent (with the
property name FILE_FILTER_CHANGED_PROPERTY) to all registered
listeners.filter - the filter (null permitted).public javax.swing.filechooser.FileFilter getFileFilter()
setFileFilter(FileFilter)public void setFileView(javax.swing.filechooser.FileView fileView)
FileView for the file chooser and sends a
PropertyChangeEvent to all registered listeners. The property
name is FILE_VIEW_CHANGED_PROPERTY.fileView - the file view (null permitted).getFileView()public javax.swing.filechooser.FileView getFileView()
FileView for the file chooser.null).public java.lang.String getName(java.io.File f)
FileView.f - the file.public java.lang.String getDescription(java.io.File f)
FileView.f - the file.public java.lang.String getTypeDescription(java.io.File f)
FileView.f - the file.public Icon getIcon(java.io.File f)
FileView.f - the file.public boolean isTraversable(java.io.File f)
true if the file is traversable, and
false otherwise.f - the file or directory.public boolean accept(java.io.File f)
true if the file is accepted by the current
file filter.f - the file.public void setFileSystemView(javax.swing.filechooser.FileSystemView fsv)
PropertyChangeEvent to all registered listeners.fsv - the file system view.public javax.swing.filechooser.FileSystemView getFileSystemView()
setFileSystemView(FileSystemView)public void approveSelection()
ActionEvent is sent to all registered
listeners.public void cancelSelection()
ActionEvent is sent to all registered
listeners.public void addActionListener(java.awt.event.ActionListener l)
ActionListener to the file chooser.l - the listener.public void removeActionListener(java.awt.event.ActionListener l)
ActionListener from this file chooser.l - the listener.public java.awt.event.ActionListener[] getActionListeners()
protected void fireActionPerformed(java.lang.String command)
command - the action command.public void updateUI()
updateUI in class JComponentpublic java.lang.String getUIClassID()
getUIClassID in class JComponentFileChooserUI.JComponent.setUI(javax.swing.plaf.ComponentUI),
JComponent.updateUI()public javax.swing.plaf.FileChooserUI getUI()
protected java.lang.String paramString()
JFileChooser component, for use in debugging. The return
value is guaranteed to be non-null, but the format of the
string may vary between implementations.paramString in class JComponentJFileChooser.public javax.accessibility.AccessibleContext getAccessibleContext()
JFileChooser component.getAccessibleContext in interface javax.accessibility.AccessiblegetAccessibleContext in class JComponentJFileChooser.AccessibleJFileChooser).