[CODE]class MyExtension extends javax.swing.filechooser.FileFilter{
private String ends,des;
public MyExtension(String ends,String des){
this.ends=ends.toLowerCase();
this.des=des;
}
public boolean accept(File f) {
if(f.isDirectory()){
return true;
}else{
return f.getName().toLowerCase().endsWith(ends);
}
}
public String getDescription() {
return des;
}
}[/CODE]
看看