public class ExtensionFileFilter
extends javax.swing.filechooser.FileFilter
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
description
A description for the file type.
|
private java.lang.String |
extension
The extension (for example, "png" for *.png files).
|
| Constructor and Description |
|---|
ExtensionFileFilter(java.lang.String description,
java.lang.String extension)
Standard constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(java.io.File file)
Returns true if the file ends with the specified extension.
|
java.lang.String |
getDescription()
Returns the description of the filter.
|
private java.lang.String description
private java.lang.String extension
public ExtensionFileFilter(java.lang.String description,
java.lang.String extension)
description - a description of the file type;extension - the file extension;public boolean accept(java.io.File file)
accept in class javax.swing.filechooser.FileFilterfile - the file to test.public java.lang.String getDescription()
getDescription in class javax.swing.filechooser.FileFilter