1 package com.calipso.reportgenerator.userinterface; 2 3 import javax.swing.filechooser.FileFilter ; 4 import java.io.File ; 5 8 9 public class ExtensionFilter extends FileFilter { 10 private String extension; 11 private String description; 12 13 18 19 public ExtensionFilter(String extension , String description) { 20 this.extension = extension; 21 this.description = description; 22 } 23 24 29 public boolean accept(File file) { 30 return (file.isDirectory() || file.getName().toLowerCase().endsWith(extension)); 31 } 32 33 37 public String getDescription() { 38 return description; 39 } 40 } 41 | Popular Tags |