01: package vicazh.hyperpool;
02:
03: import java.io.File;
04: import javax.swing.filechooser.*;
05:
06: /**
07: * The file filter
08: *
09: * @author Victor Zhigunov
10: * @version 0.3.6
11: */
12: public class IFileFilter extends FileFilter {
13: public String extension;
14:
15: private String description;
16:
17: public IFileFilter(String extension, String description) {
18: this .extension = extension;
19: this .description = description;
20: }
21:
22: public boolean accept(File f) {
23: if (f.isDirectory() || f.getName().endsWith('.' + extension))
24: return true;
25: return false;
26: }
27:
28: public String getDescription() {
29: return description;
30: }
31: }
|