Here is the code I am using now:
Code:JFrame frame = new JFrame();
String filename = "Desktop";
JFileChooser fc = new JFileChooser(new File(filename));
fc.setFileFilter(new FileFilter() {
public String getDescription() { return "CSV file"; }
public boolean accept(File f) {
if(f.isDirectory()) return true;
if(f.getName().endsWith(".csv")) return true;
return false;
}
});
// Show open dialog; this method does not return until the dialog is closed
fc.showOpenDialog(frame);
file1 = fc.getSelectedFile();
How do I edit this code so that when the filechooser pops up it automatically goes to the Desktop folder. I am on a mac.
Thanks
