protected void fileOpen() { JFileChooser chooser = null; if (currentFile == null) { chooser = new JFileChooser(startDirectory); } else { chooser = new JFileChooser(currentFile); } int returnVal = chooser.showOpenDialog(gw); if (returnVal == JFileChooser.APPROVE_OPTION) { graph.clear(); currentFile = chooser.getSelectedFile(); graph.loadAll(currentFile); gp.update(gp.getGraphics()); } }