if (!defaultExportDir.exists())
defaultExportDir.mkdirs();
JFileChooser fileChooser = new JFileChooser(defaultExportDir);
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
FileFilter filter = new LabeledFileFilter() {
public boolean accept(File file) {
if (file.isDirectory() || file.getAbsolutePath().endsWith(".txt"))
return true;
return false;
}
public String getDescription() {
return "Text (*.txt)";
}
public String getExtension() {
return ".txt";
}
};
fileChooser.addChoosableFileFilter(filter);
filter = new LabeledFileFilter() {
public boolean accept(File file) {
if (file.isDirectory() || file.getAbsolutePath().endsWith(".csv"))
return true;
return false;
}