()
| 1083 | |
| 1084 | |
| 1085 | private void doImportCharacters() { |
| 1086 | |
| 1087 | FileDialog dialog = new FileDialog(this, |
| 1088 | "Import Characters File...", |
| 1089 | FileDialog.LOAD); |
| 1090 | |
| 1091 | dialog.setVisible(true); |
| 1092 | if (dialog.getFile() != null) { |
| 1093 | File file = new File(dialog.getDirectory(), dialog.getFile()); |
| 1094 | |
| 1095 | try { |
| 1096 | importCharactersFromFile(file); |
| 1097 | } catch (FileNotFoundException fnfe) { |
| 1098 | JOptionPane.showMessageDialog(this, "Unable to open file: File not found", |
| 1099 | "Unable to open file", |
| 1100 | JOptionPane.ERROR_MESSAGE); |
| 1101 | } catch (IOException ioe) { |
| 1102 | JOptionPane.showMessageDialog(this, "Unable to read file: " + ioe.getMessage(), |
| 1103 | "Unable to read file", |
| 1104 | JOptionPane.ERROR_MESSAGE); |
| 1105 | } |
| 1106 | } |
| 1107 | |
| 1108 | } |
| 1109 | |
| 1110 | protected boolean importCharactersFromFile(File file) throws FileNotFoundException, IOException { |
| 1111 |
no test coverage detected