APIdia Launch Partner
Top Description Constructors Methods
javax.swing.filechooser

public abstract Class FileFilter

extends Object
Class Inheritance
Known Direct Subclasses
javax.swing.filechooser.FileNameExtensionFilter, javax.swing.plaf.basic.BasicFileChooserUI.GlobFilter, javax.swing.plaf.basic.BasicFileChooserUI.AcceptAllFileFilter, sun.swing.plaf.synth.SynthFileChooserUI.GlobFilter
Imports
java.io.File

FileFilter is an abstract class used by JFileChooser for filtering the set of files shown to the user. See FileNameExtensionFilter for an implementation that filters using the file name extension.

A FileFilter can be set on a JFileChooser to keep unwanted files from appearing in the directory listing. For an example implementation of a simple file filter, see yourJDK/demo/jfc/FileChooserDemo/ExampleFileFilter.java. For more information and examples see How to Use File Choosers, a section in The Java Tutorial.

Author
Jeff Dinkins
See Also
FileNameExtensionFilter, javax.swing.JFileChooser#setFileFilter, javax.swing.JFileChooser#addChoosableFileFilter

Constructor Summary

AccessConstructor and Description
protected
FileFilter()

Constructor for subclasses to call.

Method Summary

Modifier and TypeMethod and Description
public abstract boolean

Returns:

true if the file is to be accepted
accept
(File
the File to test
f
)

Whether the given file is accepted by this filter.

public abstract String

Returns:

the description of this filter
getDescription
()

The description of this filter.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

FileFilterback to summary
protected FileFilter()

Constructor for subclasses to call.

Method Detail

acceptback to summary
public abstract boolean accept(File f)

Whether the given file is accepted by this filter.

Parameters
f:File

the File to test

Returns:boolean

true if the file is to be accepted

getDescriptionback to summary
public abstract String getDescription()

The description of this filter. For example: "JPG and GIF Images"

Returns:String

the description of this filter

See Also
FileView#getName