org.jfree.ui

Class ExtensionFileFilter

public class ExtensionFileFilter extends FileFilter

A filter for JFileChooser that filters files by extension.

Author: David Gilbert

Constructor Summary
ExtensionFileFilter(String description, String extension)
Standard constructor.
Method Summary
booleanaccept(File file)
Returns true if the file ends with the specified extension.
StringgetDescription()
Returns the description of the filter.

Constructor Detail

ExtensionFileFilter

public ExtensionFileFilter(String description, String extension)
Standard constructor.

Parameters: description a description of the file type; extension the file extension;

Method Detail

accept

public boolean accept(File file)
Returns true if the file ends with the specified extension.

Parameters: file the file to test.

Returns: A boolean that indicates whether or not the file is accepted by the filter.

getDescription

public String getDescription()
Returns the description of the filter.

Returns: a description of the filter.