just the basics
<code>
JFileChooser saver = new JFileChooser();
int val = saver.showSaveDialog(this);
if (val == JFileChooser.APPROVE_OPTION)
//assume an already created File variable file
file = saver.getSelectedFile();
else
return;
// save the file to hard drive
try {//assume you have some text area named editor
editor.write( new BufferedWriter( new FileWriter(file) ) );
}
catch (IOException ioe) {
ioe.printStackTrace();
}
</code>
That should get you started anyway
Here's a simple example of using FileDialog instead of JFileChooser//parentFrame is the GUI Frame
FileDialog fileDialog = new FileDialog(parentFrame,"Title");
fileDialog.setMode(FileDialog.SAVE);
fileDialog.show();
String yourNewFileName = fileDialog.getFile();
File saveFile = new File(yourNewFileName);
saveFile.createNewFile();
//
//now copy your data to the file...
//