public void saveAs(ActionEvent e) { int returnVal = fc.showSaveDialog(this); if (returnVal != JFileChooser.APPROVE_OPTION) { return; } file = fc.getSelectedFile(); save(e); }
public void loadPuzzle(ActionEvent e) throws NoSuchMethodException { int returnVal = fc.showOpenDialog(this); if (returnVal != JFileChooser.APPROVE_OPTION) { return; } file = fc.getSelectedFile(); Map m = new HashMap(); m.put("file", file); mgr.switchScreens(m); }
public void load(ActionEvent e) { int returnVal = fc.showOpenDialog(this); if (returnVal != JFileChooser.APPROVE_OPTION) { return; } file = fc.getSelectedFile(); try { InputStream in = new BufferedInputStream(new FileInputStream(file)); Properties newWl = new Properties(); newWl.load(in); in.close(); setWordList(newWl); } catch (IOException ex) { handleException(ex); } }