loadMI.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
JFileChooser chooser = new JFileChooser(PATH_RULEFILES);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
chooser.setFileFilter(new FileNameExtensionFilter("JSON Save files", "json"));
if(chooser.showDialog(that, "Load") == JFileChooser.APPROVE_OPTION) {
String fileName = chooser.getSelectedFile().getAbsolutePath();
that.saveLoader.load(fileName);
}
}
});
// create JMenuItem to save...
JMenuItem saveMI = new JMenuItem("Save");
saveMI.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
SaveDialog chooser = new SaveDialog(PATH_RULEFILES);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
chooser.setFileFilter(new FileNameExtensionFilter("JSON Save files", "json"));
if(chooser.showDialog(that, "Save") == SaveDialog.APPROVE_OPTION) {
String fileName = chooser.getSelectedFile().getAbsolutePath();
if(!fileName.endsWith(".json")) {