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");
|
||||
fileChooser.setFileFilter(filter);
|
||||
|
||||
int returnVal = fileChooser.showOpenDialog(mazeApp);
|
||||
int returnVal = fileChooser.showSaveDialog(mazeApp);
|
||||
if(returnVal == JFileChooser.APPROVE_OPTION) {
|
||||
System.out.println("You chose to save to this file: " +
|
||||
fileChooser.getSelectedFile().getName());
|
||||
|
||||
Reference in new issue
Block a user