I am trying to use a FileDialog file chooser because I really need java app to have the native apple file chooser (I know we all hate hate the lack of portability but this is what I need). I am trying to make my file chooser allow the user to pick files that end with .ws. Here is what I tried:
FileDialog fd = new
FileDialog(_sharedInstance,rsc.str("480"),FileDialog.LOAD);
// fd.setFile("*.ws");
class WSFilter implements FilenameFilter {
public boolean accept(File dir, String name) {
return (name.endsWith(".ws"));
}
};
FilenameFilter wsFilter = new WSFilter();
fd.setFilenameFilter(wsFilter);
fd.setDirectory(_projectsBaseDir.getPath());
fd.setLocation(50,50);
// fd.setFile("*");
fd.setVisible(true);
For some reason my file chooser won't allow me to pick any files. Any ideas?