public class FilenameExtensionFilter
extends javax.swing.filechooser.FileFilter
implements java.io.FilenameFilter
Constructor and Description |
---|
FilenameExtensionFilter(java.lang.String aExtension)
This constructor takes an extension to filter on.
|
FilenameExtensionFilter(java.lang.String aExtension,
java.lang.String aDescription)
This constructor takes an extension to filter on.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.io.File f) |
boolean |
accept(java.io.File dir,
java.lang.String name)
Tests if a specified file should be included in a file list.
|
java.lang.String |
getDescription() |
public FilenameExtensionFilter(java.lang.String aExtension)
aExtension
- String with the extension to filter. Note that
'.class' is identical to 'class'.public FilenameExtensionFilter(java.lang.String aExtension, java.lang.String aDescription)
aExtension
- String with the extension to filter. Note that
'.class' is identical to 'class'.aDescription
- String with the description for the FileFilter.
Can be null in which case the description will be an empty String.public boolean accept(java.io.File dir, java.lang.String name)
accept
in interface java.io.FilenameFilter
dir
- the directory in which the file was found.name
- the name of the file.true
if and only if the name should be
included in the file list; false
otherwise.public boolean accept(java.io.File f)
accept
in class javax.swing.filechooser.FileFilter
public java.lang.String getDescription()
getDescription
in class javax.swing.filechooser.FileFilter
Copyright © 2013. All Rights Reserved.