/** Initialize the application.
*/
public void initializeApp() {
// Create and initialize the storage policy
try {
DefaultStoragePolicy storage = new DefaultStoragePolicy();
setStoragePolicy(storage);
FileFilter ff = new FileFilter() {
public boolean accept(File file) {
return GUIUtilities.getFileExtension(file).toLowerCase()
.equals("txt");
}
public String getDescription() {
return "Text files";
}
};
JFileChooser fc;
fc = storage.getOpenFileChooser();
fc.addChoosableFileFilter(ff);
fc.setFileFilter(ff);
fc = storage.getSaveFileChooser();
fc.addChoosableFileFilter(ff);
fc.setFileFilter(ff);
} catch (SecurityException ex) {
// FIXME: create a new "NoStoragePolicy"
}