javax.swing.filechooser

Class FileFilter

public abstract class FileFilter extends Object

The base class for filters that control the visibility of files in the {@link JFileChooser} component.

See Also:

Constructor Summary
FileFilter()
Default constructor.
Method Summary
abstract booleanaccept(File file)
Returns true if the specified file matches the filter, and false otherwise.
abstract StringgetDescription()
Returns a description of the files that will be selected by the filter (for example, "Java source files").

Constructor Detail

FileFilter

public FileFilter()
Default constructor.

Method Detail

accept

public abstract boolean accept(File file)
Returns true if the specified file matches the filter, and false otherwise.

Parameters: file the file.

Returns: A boolean.

getDescription

public abstract String getDescription()
Returns a description of the files that will be selected by the filter (for example, "Java source files"). This description will usually be displayed on the {@link JFileChooser} component, often in a combo box that is used to select the appropriate filter (in cases where more than one filter is available).

Returns: A description of the filter.