Note that as of Java 1.6, there is a FileNameExtensionFilter which
replaces this class. See
http://download.oracle.com/javase/6/docs/api/javax/swing/filechooser/FileNameExtensionFilter.html
However, this class can be used with both java.awt.FileDialog
and javax.swing.JFileChooser because it implements java.io.FilenameFilter
and extends javax.swing.FilenameFilter.

ExtensionFileFilter

Creates a file filter that accepts the given file type.
Example: new ExtensionFileFilter("jpg", "JPEG Image Images");
Note that the "." before the extension is not needed. If
provided, it will be ignored.

ExtensionFileFilter

Creates a file filter from the given string array and description.
Example: new ExtensionFileFilter(String {"gif", "jpg"}, "Gif and JPG Images");
Note that the "." before the extension is not needed and will be
ignored.

getDefaultExtension

If the filter contains only one extension, return the extension
name. Otherwise, return null.
Added by Heloise Hse

getExtension

public java.lang.String getExtension(java.io.File f)

Deprecated.

Return the extension portion of the file's name .

addExtension

public void addExtension(java.lang.String extension)

Deprecated.

Adds a filetype "dot" extension to filter against.
For example: the following code will create a filter that filters
out all files except those that end in ".jpg" and ".tif":
ExtensionFileFilter filter = new ExtensionFileFilter();
filter.addExtension("jpg");
filter.addExtension("tif");
Note that the "." before the extension is not needed and will be ignored.