Change the way of drawing the maze #22
No files matched your search
@@ -32,13 +32,13 @@ public class LoadMazeMenuItem extends JMenuItem
|
||||
new FileNameExtensionFilter("Text files", "txt");
|
||||
fileChooser.setFileFilter(filter);
|
||||
|
||||
String filename;
|
||||
int returnVal = fileChooser.showOpenDialog(mazeApp);
|
||||
if(returnVal == JFileChooser.APPROVE_OPTION) {
|
||||
System.out.println("You chose to open this file: " +
|
||||
fileChooser.getSelectedFile().getName());
|
||||
}
|
||||
|
||||
String filename = fileChooser.getSelectedFile().getPath();
|
||||
filename = fileChooser.getSelectedFile().getPath();
|
||||
mazeApp.getMazeAppModel().setMaze(new Maze(filename));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,9 +34,8 @@ public class SaveMazeMenuItem extends JMenuItem
|
||||
if(returnVal == JFileChooser.APPROVE_OPTION) {
|
||||
System.out.println("You chose to save to this file: " +
|
||||
fileChooser.getSelectedFile().getName());
|
||||
}
|
||||
|
||||
String filename = fileChooser.getSelectedFile().getPath();
|
||||
mazeApp.getMazeAppModel().saveToFile(filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user