Thu Jun 28, 2007 5:45 am
import javax.swing.filechooser.FileFilter;
loadPub.addChoosableFileFilter(new FileFilter() //adds new filter into list
{
String description = "Publisher Files (*.pbb)";
/*change text within "" to text you want to appear in File Chooser*/
String extension = "pbb";
/*change text within "" for Filter you want created*/
public String getDescription()
{
return description;
}
public boolean accept(File f)
{
if(f == null) return false;
if(f.isDirectory()) return true;
return f.getName().toLowerCase().endsWith(extension);
}
});
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.