// Stores the current directory and loads the selected file.
File file = chooser.getSelectedFile();
if(returnVal == JFileChooser.APPROVE_OPTION && isMidiFile(file)) {
- directory = chooser.getSelectedFile().getParentFile();
+ directory = file.getParentFile();
if (!Moosique.promptOnUnsavedChanges())
- Moosique.load(chooser.getSelectedFile().getAbsolutePath());
+ Moosique.load(file);
}
} else if (command == "Save") {
if (!Moosique.save()) showSaveAsDialog();
File file = chooser.getSelectedFile();
if(returnVal == JFileChooser.APPROVE_OPTION && isMidiFile(file)) {
directory = file.getParentFile();
- Moosique.saveAs(file.getAbsolutePath());
+ Moosique.saveAs(file);
}
}