Package adams.gui.chooser
Class BaseFileChooser
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JFileChooser
-
- adams.gui.chooser.BaseFileChooser
-
- All Implemented Interfaces:
FileChooser
,ImageObserver
,MenuContainer
,Serializable
,Accessible
- Direct Known Subclasses:
AbstractExtensionFileFilterFileChooser
,JavaDirectoryChooser
,JComponentWriterFileChooser
,TextFileChooser
public class BaseFileChooser extends JFileChooser implements FileChooser
A file chooser dialog based on the one developed by the VFSJFileChooser project.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JFileChooser
JFileChooser.AccessibleJFileChooser
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_AllowGlobFilters
whether glob filters (eg "*.txt") are allowed.protected boolean
m_AutoAppendExtension
whether to automatically append extension.protected String
m_DefaultExtension
the default extension.protected FileChooserBookmarksPanel
m_PanelBookmarks
the bookmarks.protected JPanel
m_PanelBookmarksAndFilter
the panel with the bookmarks and filter.protected FilterPanel
m_PanelFilter
the panel for the filter.protected boolean
m_PromptOverwriteFile
whether to ask to overwrite an existing file (using the save dialog).-
Fields inherited from class javax.swing.JFileChooser
ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY, accessibleContext, ACCESSORY_CHANGED_PROPERTY, APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY, APPROVE_BUTTON_TEXT_CHANGED_PROPERTY, APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY, APPROVE_OPTION, APPROVE_SELECTION, CANCEL_OPTION, CANCEL_SELECTION, CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY, CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY, CUSTOM_DIALOG, DIALOG_TITLE_CHANGED_PROPERTY, DIALOG_TYPE_CHANGED_PROPERTY, DIRECTORIES_ONLY, DIRECTORY_CHANGED_PROPERTY, ERROR_OPTION, FILE_FILTER_CHANGED_PROPERTY, FILE_HIDING_CHANGED_PROPERTY, FILE_SELECTION_MODE_CHANGED_PROPERTY, FILE_SYSTEM_VIEW_CHANGED_PROPERTY, FILE_VIEW_CHANGED_PROPERTY, FILES_AND_DIRECTORIES, FILES_ONLY, MULTI_SELECTION_ENABLED_CHANGED_PROPERTY, OPEN_DIALOG, SAVE_DIALOG, SELECTED_FILE_CHANGED_PROPERTY, SELECTED_FILES_CHANGED_PROPERTY
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
Constructor Summary
Constructors Constructor Description BaseFileChooser()
Constructs aBaseFileChooser
pointing to the user's default directory.BaseFileChooser(File currentDirectory)
Constructs aBaseFileChooser
using the givenFile
as the path.BaseFileChooser(String currentDirectoryPath)
Constructs aBaseFileChooser
using the given path.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(File f)
Returns true if the file should be displayed.void
addChoosableFileFilter(FileFilter filter)
Adds the file filter.protected boolean
checkFilter(FileFilter filter)
Checks the filter whether it can be set.protected JComponent
createAccessoryPanel()
Creates an accessory panel displayed next to the files.static File
findExistingDir(File dir)
Returns a directory that exists, starting with the provided one.protected File
fixPrefix(File file)
Fixes the file prefix if the user accidentally pasted a filename starting with "file:///".boolean
getAllowGlobFilters()
Returns whether the user can enter glob filters like "*.txt".boolean
getAutoAppendExtension()
Returns whether to automatically append the currently selected file extension or the default one (if All-Filter is used).PlaceholderDirectory
getCurrentPlaceholderDirectory()
Returns the current directory.protected Dimension
getDefaultAccessoryDimension()
Returns the preferred dimension.String
getDefaultExtension()
Returns the default extension.boolean
getPromptOverwriteFile()
Returns whether the user gets prompted by the save dialog if the selected file already exists.File[]
getSelectedFiles()
Returns a list of selected files if the file chooser is set to allow multiple selection.PlaceholderFile
getSelectedPlaceholderFile()
Returns the selected file as PlaceholderFile.PlaceholderFile[]
getSelectedPlaceholderFiles()
Returns a list of selected files as PlaecholderFile objects if the file chooser is set to allow multiple selection.protected static void
handleException(String msg, Throwable t)
Outputs the error in the console window.protected boolean
hasCorrectExtension(File file, String[] extensions)
Checks the filename, whether it has an extension from the provided list.protected void
initialize()
For initializing some stuff.protected boolean
isGlobFilter(FileFilter filter)
Returns whether the filter is a "glob" filter, e.g., when the user enters "*.txt" manually.boolean
isJComponent()
Returns whether the file chooser is a JComponent and can be embedded in other components.void
setAllowGlobFilters(boolean value)
Sets whether the user can enter glob filters like "*.txt".void
setAutoAppendExtension(boolean value)
Sets whether to automatically append the currently selected file extension or the default one (if All-Filter is used).void
setCurrentDirectory(File dir)
Sets the current directory.void
setDefaultExtension(String value)
Sets the default extension.void
setFileFilter(FileFilter filter)
Sets the current file filter.void
setPromptOverwriteFile(boolean value)
Sets whether the user gets prompted by the save dialog if the selected file already exists.void
setSelectedFile(File file)
Sets the selected file.void
setSelectedFiles(File[] selectedFiles)
Sets the list of selected files if the file chooser is set to allow multiple selection.int
showDialog(Component parent, String approveButtonText)
Displays the dialog.-
Methods inherited from class javax.swing.JFileChooser
addActionListener, approveSelection, cancelSelection, changeToParentDirectory, createDialog, ensureFileIsVisible, fireActionPerformed, getAcceptAllFileFilter, getAccessibleContext, getAccessory, getActionListeners, getApproveButtonMnemonic, getApproveButtonText, getApproveButtonToolTipText, getChoosableFileFilters, getControlButtonsAreShown, getCurrentDirectory, getDescription, getDialogTitle, getDialogType, getDragEnabled, getFileFilter, getFileSelectionMode, getFileSystemView, getFileView, getIcon, getName, getSelectedFile, getTypeDescription, getUI, getUIClassID, isAcceptAllFileFilterUsed, isDirectorySelectionEnabled, isFileHidingEnabled, isFileSelectionEnabled, isMultiSelectionEnabled, isTraversable, paramString, removeActionListener, removeChoosableFileFilter, rescanCurrentDirectory, resetChoosableFileFilters, setAcceptAllFileFilterUsed, setAccessory, setApproveButtonMnemonic, setApproveButtonMnemonic, setApproveButtonText, setApproveButtonToolTipText, setControlButtonsAreShown, setDialogTitle, setDialogType, setDragEnabled, setFileHidingEnabled, setFileSelectionMode, setFileSystemView, setFileView, setMultiSelectionEnabled, setup, showOpenDialog, showSaveDialog, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, 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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, 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, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.gui.chooser.FileChooser
addActionListener, approveSelection, cancelSelection, changeToParentDirectory, ensureFileIsVisible, getAcceptAllFileFilter, getAccessory, getActionListeners, getApproveButtonMnemonic, getApproveButtonText, getApproveButtonToolTipText, getChoosableFileFilters, getControlButtonsAreShown, getCurrentDirectory, getDescription, getDialogTitle, getDialogType, getDragEnabled, getFileFilter, getFileSelectionMode, getFileSystemView, getFileView, getIcon, getName, getSelectedFile, getTypeDescription, isAcceptAllFileFilterUsed, isDirectorySelectionEnabled, isFileHidingEnabled, isFileSelectionEnabled, isMultiSelectionEnabled, isTraversable, removeActionListener, removeChoosableFileFilter, rescanCurrentDirectory, resetChoosableFileFilters, setAcceptAllFileFilterUsed, setAccessory, setApproveButtonMnemonic, setApproveButtonMnemonic, setApproveButtonText, setApproveButtonToolTipText, setControlButtonsAreShown, setDialogTitle, setDialogType, setDragEnabled, setFileHidingEnabled, setFileSelectionMode, setFileSystemView, setFileView, setMultiSelectionEnabled, showOpenDialog, showSaveDialog
-
-
-
-
Field Detail
-
m_PromptOverwriteFile
protected boolean m_PromptOverwriteFile
whether to ask to overwrite an existing file (using the save dialog).
-
m_AutoAppendExtension
protected boolean m_AutoAppendExtension
whether to automatically append extension.
-
m_AllowGlobFilters
protected boolean m_AllowGlobFilters
whether glob filters (eg "*.txt") are allowed.
-
m_DefaultExtension
protected String m_DefaultExtension
the default extension.
-
m_PanelBookmarksAndFilter
protected JPanel m_PanelBookmarksAndFilter
the panel with the bookmarks and filter.
-
m_PanelFilter
protected FilterPanel m_PanelFilter
the panel for the filter.
-
m_PanelBookmarks
protected FileChooserBookmarksPanel m_PanelBookmarks
the bookmarks.
-
-
Constructor Detail
-
BaseFileChooser
public BaseFileChooser()
Constructs aBaseFileChooser
pointing to the user's default directory. This default depends on the operating system. It is typically the "My Documents" folder on Windows, and the user's home directory on Unix.
-
BaseFileChooser
public BaseFileChooser(String currentDirectoryPath)
Constructs aBaseFileChooser
using the given path. Passing in anull
string causes the file chooser to point to the user's default directory. This default depends on the operating system. It is typically the "My Documents" folder on Windows, and the user's home directory on Unix.- Parameters:
currentDirectoryPath
- aString
giving the path to a file or directory
-
BaseFileChooser
public BaseFileChooser(File currentDirectory)
Constructs aBaseFileChooser
using the givenFile
as the path. Passing in anull
file causes the file chooser to point to the user's default directory. This default depends on the operating system. It is typically the "My Documents" folder on Windows, and the user's home directory on Unix.- Parameters:
currentDirectory
- aFile
object specifying the path to a file or directory
-
-
Method Detail
-
initialize
protected void initialize()
For initializing some stuff.
-
getDefaultAccessoryDimension
protected Dimension getDefaultAccessoryDimension()
Returns the preferred dimension.- Returns:
- the dimension, null if to use default
-
createAccessoryPanel
protected JComponent createAccessoryPanel()
Creates an accessory panel displayed next to the files.- Returns:
- the panel or null if none available
-
setPromptOverwriteFile
public void setPromptOverwriteFile(boolean value)
Sets whether the user gets prompted by the save dialog if the selected file already exists.- Parameters:
value
- if true, then the user will get prompted if file already exists
-
getPromptOverwriteFile
public boolean getPromptOverwriteFile()
Returns whether the user gets prompted by the save dialog if the selected file already exists.- Returns:
- true if the user will get prompted
-
setAutoAppendExtension
public void setAutoAppendExtension(boolean value)
Sets whether to automatically append the currently selected file extension or the default one (if All-Filter is used).- Parameters:
value
- if true, then the file extension will be added automatically
-
getAutoAppendExtension
public boolean getAutoAppendExtension()
Returns whether to automatically append the currently selected file extension or the default one (if All-Filter is used).- Returns:
- true if the file extension will be added automatically
-
setDefaultExtension
public void setDefaultExtension(String value)
Sets the default extension. Is used if m_AutoAppendExtension is true and the All-Filter is selected.- Parameters:
value
- the extension (without dot), use null to unset
-
getDefaultExtension
public String getDefaultExtension()
Returns the default extension. Is used if m_AutoAppendExtension is true and the All-Filter is selected.- Returns:
- the extension, can be null
-
setAllowGlobFilters
public void setAllowGlobFilters(boolean value)
Sets whether the user can enter glob filters like "*.txt".- Parameters:
value
- if true, then the user can enter glob filters
-
getAllowGlobFilters
public boolean getAllowGlobFilters()
Returns whether the user can enter glob filters like "*.txt".- Returns:
- true if the user can enter glob filters
-
isGlobFilter
protected boolean isGlobFilter(FileFilter filter)
Returns whether the filter is a "glob" filter, e.g., when the user enters "*.txt" manually.- Parameters:
filter
- the filter to check- Returns:
- true if a glob filter
-
checkFilter
protected boolean checkFilter(FileFilter filter)
Checks the filter whether it can be set.- Parameters:
filter
- the filter to set- Returns:
- true if check passed and valid
-
setFileFilter
public void setFileFilter(FileFilter filter)
Description copied from interface:FileChooser
Sets the current file filter. The file filter is used by the file chooser to filter out files from the user's view.- Specified by:
setFileFilter
in interfaceFileChooser
- Overrides:
setFileFilter
in classJFileChooser
- Parameters:
filter
- the new current file filter to use- See Also:
FileChooser.getFileFilter()
-
addChoosableFileFilter
public void addChoosableFileFilter(FileFilter filter)
Adds the file filter. Has to be aExtensionFileFilter
.- Specified by:
addChoosableFileFilter
in interfaceFileChooser
- Overrides:
addChoosableFileFilter
in classJFileChooser
- Parameters:
filter
- the filter to add- See Also:
ExtensionFileFilter
-
fixPrefix
protected File fixPrefix(File file)
Fixes the file prefix if the user accidentally pasted a filename starting with "file:///".- Parameters:
file
- the fix to check and fix- Returns:
- the potentially fixed file
-
setSelectedFile
public void setSelectedFile(File file)
Sets the selected file. If the file's parent directory is not the current directory, changes the current directory to be the file's parent directory.- Specified by:
setSelectedFile
in interfaceFileChooser
- Overrides:
setSelectedFile
in classJFileChooser
- Parameters:
file
- the selected file- See Also:
JFileChooser.getSelectedFile()
-
getSelectedPlaceholderFile
public PlaceholderFile getSelectedPlaceholderFile()
Returns the selected file as PlaceholderFile. This can be set either by the programmer viasetFile
or by a user action, such as either typing the filename into the UI or selecting the file from a list in the UI.- Returns:
- the selected file, converted to PlaceholderFile
-
setSelectedFiles
public void setSelectedFiles(File[] selectedFiles)
Sets the list of selected files if the file chooser is set to allow multiple selection.- Specified by:
setSelectedFiles
in interfaceFileChooser
- Overrides:
setSelectedFiles
in classJFileChooser
- Parameters:
selectedFiles
- the files to select initially
-
getSelectedFiles
public File[] getSelectedFiles()
Returns a list of selected files if the file chooser is set to allow multiple selection.
Fixes the problem with JFileChooser of not returning anything sometimes when only a single file is selected.- Specified by:
getSelectedFiles
in interfaceFileChooser
- Overrides:
getSelectedFiles
in classJFileChooser
- Returns:
- the selected files
-
getSelectedPlaceholderFiles
public PlaceholderFile[] getSelectedPlaceholderFiles()
Returns a list of selected files as PlaecholderFile objects if the file chooser is set to allow multiple selection.- Returns:
- the selected files, converted to PlaceholderFile objects
-
hasCorrectExtension
protected boolean hasCorrectExtension(File file, String[] extensions)
Checks the filename, whether it has an extension from the provided list.- Parameters:
file
- the file to checkextensions
- the extensions to check against- Returns:
- true if valid extension
-
showDialog
public int showDialog(Component parent, String approveButtonText)
Displays the dialog.- Specified by:
showDialog
in interfaceFileChooser
- Overrides:
showDialog
in classJFileChooser
- Parameters:
parent
- the parent component of the dialog; can benull
approveButtonText
- the text of theApproveButton
- Returns:
- the return state of the file chooser on popdown
- Throws:
HeadlessException
- if GraphicsEnvironment.isHeadless() returns true.- See Also:
GraphicsEnvironment.isHeadless()
-
getCurrentPlaceholderDirectory
public PlaceholderDirectory getCurrentPlaceholderDirectory()
Returns the current directory.- Returns:
- the current directory, as PlaceholderDirectory
- See Also:
setCurrentDirectory(java.io.File)
-
setCurrentDirectory
public void setCurrentDirectory(File dir)
Sets the current directory. Passing innull
sets the file chooser to point to the user's default directory. This default depends on the operating system. It is typically the "My Documents" folder on Windows, and the user's home directory on Unix. If the file passed in ascurrentDirectory
is not a directory, the parent of the file will be used as the currentDirectory. If the parent is not traversable, then it will walk up the parent tree until it finds a traversable directory, or hits the root of the file system.- Specified by:
setCurrentDirectory
in interfaceFileChooser
- Overrides:
setCurrentDirectory
in classJFileChooser
- Parameters:
dir
- the current directory to point to- See Also:
JFileChooser.getCurrentDirectory()
-
findExistingDir
public static File findExistingDir(File dir)
Returns a directory that exists, starting with the provided one. If path cannot be used at all, they current working directory ("user.dir") is returned.- Parameters:
dir
- the starting dir- Returns:
- the existing dir
-
accept
public boolean accept(File f)
Returns true if the file should be displayed. If a filter string is entered, then this must be present in the file name (case-insensitive).- Specified by:
accept
in interfaceFileChooser
- Overrides:
accept
in classJFileChooser
- Parameters:
f
- theFile
- Returns:
- true if the file should be displayed, otherwise false
- See Also:
FileFilter.accept(java.io.File)
-
isJComponent
public boolean isJComponent()
Returns whether the file chooser is a JComponent and can be embedded in other components.- Specified by:
isJComponent
in interfaceFileChooser
- Returns:
- true if JComponent-derived
-
-