Use proper dialog type for the "Save Maze" button
Instead of using showOpenDialog(), use showSaveDialog()
This commit is contained in:
1 file changed
+1
-1
@@ -30,7 +30,7 @@ public class SaveMazeMenuItem extends JMenuItem
|
|||||||
new FileNameExtensionFilter("Text files", "txt");
|
new FileNameExtensionFilter("Text files", "txt");
|
||||||
fileChooser.setFileFilter(filter);
|
fileChooser.setFileFilter(filter);
|
||||||
|
|
||||||
int returnVal = fileChooser.showOpenDialog(mazeApp);
|
int returnVal = fileChooser.showSaveDialog(mazeApp);
|
||||||
if(returnVal == JFileChooser.APPROVE_OPTION) {
|
if(returnVal == JFileChooser.APPROVE_OPTION) {
|
||||||
System.out.println("You chose to save to this file: " +
|
System.out.println("You chose to save to this file: " +
|
||||||
fileChooser.getSelectedFile().getName());
|
fileChooser.getSelectedFile().getName());
|
||||||
|
|||||||
Reference in new issue
Block a user