private void handleOpen() { if (file != null) fc.setCurrentDirectory(file); int retVal = fc.showOpenDialog(this); if (retVal == JFileChooser.APPROVE_OPTION) { file = fc.getSelectedFile(); String fileContents = ""; try { fileContents = FileUtils.readFileToString(file); panel.setText(fileContents); panel.format(); } catch (IOException e) { log.warn(e.getMessage(), e); } } }
private void handleNew() { panel.setText(""); panel.format(); }