John W. Campbell
This class provides a File Filter based on the file extension
(case insensitive).
This file filter may be used in conjunction with the JdlFileChooser file
chooser (selector) object.
Class, constructor and methods:
Class Details
Accessible Fields
Constructor
Methods
- Package:
- Jdl.JdlLib;
- Class name:
- JdlExtFilter
- Class definition:
- public class JdlExtFilter
- Extends:
- javax.swing.filechooser.FileFilter
- Implements:
- none
- Actions:
- none
No fields with public, package or protected access defined.
A single constructor is available.
Constructor:
Standard constructor
Constructs a JdlExtFilter File Filter object based on a file extension.
- Constructor Definition:
- public JdlExtFilter(String ext, String description)
- Parameters List:
- ext
- The file extension (starting with the dot e.g. .jpeg).
- description
- A brief description of the file type.
This section contains methods for testing a file name against the filter
and for returning the file type description.
Methods:
Accept file - accept
Get description - getDescription
See if the file is to be accepted by comparing its extension with that
specified for the file extension filter.
- Method Definition:
- public boolean accept(File fil)
- Parameters List:
- fil
- The name of the file to be tested.
- Method Return:
-
Returns true if the extension matches, otherwise false.
This method returns the file type description as set via the constructor.
- Method Definition:
- public String getDescription()
- Parameters List:
- none
- Method Return:
-
The file type description.
⇑ Up 2
⇑ Up 1
⇑ Top of this