Use proper dialog type for the "Save Maze" button

Instead of using showOpenDialog(), use showSaveDialog()
This commit is contained in:
regar42 committed 2017-12-20 01:18:37 +01:00
1 parent 53ee6f1565
commit 987fb858e4
1 file changed
+1 -1
+1 -1
View File
@@ -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());