I'm making a chess game, and I want to add saving functionality, I'm planning on outputting the file as a txt file that will contain all the information that the program will need to restore the games status, but I want it to be so that when the save button is clicked, a dialog opens that allows the user to pick the directory and name that the file will be saved as. I already know how to use actionlisteners for the button actions, just not how to open the dialog box
Asked
Active
Viewed 77 times
0
-
You should use [a file chooser](http://docs.oracle.com/javase/tutorial/uiswing/components/filechooser.html) and use [the save dialog option](http://docs.oracle.com/javase/6/docs/api/javax/swing/JFileChooser.html#showSaveDialog%28java.awt.Component%29) – Jonathan Drapeau Aug 12 '14 at 17:23
1 Answers
0
You can use JDialog class for creating Dialog Box.Also on Dialogbox you need to you JFileChooser to allow user to browse and select the folder.More information on JDialog can be found here and here

Sachin Janani
- 1,310
- 1
- 17
- 33