你是说FileFilter?..
那是个抽象类....
它有两个抽象方法accept()和getDescription(),要求继承它的类要实现这两个方法的具体...
详细..可以看Java Api
给个例子你看看...
class objFileFilter extends javax.swing.filechooser.FileFilter{
private String strDescription;
private String strEnds;
public objFileFilter(String strEnds,String strDescription){
this.strDescription = strDescription;
this.strEnds = strEnds;
}
public boolean accept(File file){
if(file.isDirectory()) return true;
String strFile = file.getName();
if(strFile.toUpperCase().endsWith(strEnds.toUpperCase()))
return true;
else
return false;
}
public String getDescription(){
return strDescription;
}
}