예제 #1
0
 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);
     }
   }
 }
예제 #2
0
 private void handleNew() {
   panel.setText("");
   panel.format();
 }