Possible Duplicate:
JFileChooser.showSaveDialog(…) - how to set suggested file name
I have seen this question asked a few times but no answer has been any help to me. I want the save dialog to suggest a file name like "myFile.txt" using JFileChooser.
Heres what i have:
JFileChooser jFileChooser = new JFileChooser();
jFileChooser.setCurrentDirectory(new File("C:\\"));
jFileChooser.showSaveDialog(null);
This will do it:
jFileChooser.setSelectedFile(new File(optionalPath + "myFile.txt"));