()
| 215 | } |
| 216 | |
| 217 | public void createNewWorld() { |
| 218 | final String name = JOptionPane.showInputDialog(this, "Enter new world name", "New world", JOptionPane.PLAIN_MESSAGE); |
| 219 | if (name != null && !name.isEmpty()) { |
| 220 | // create a new world |
| 221 | try { |
| 222 | final World world = WorldManager.getNewWorld(name); |
| 223 | createTab(world); |
| 224 | } catch (final Exception ex) { |
| 225 | Logger.getLogger(Mainwindow.class.getName()).log(Level.SEVERE, null, ex); |
| 226 | JOptionPane.showMessageDialog(this, StringHelper.join("Couldn't create world \"", name, "\":\n", ex.getMessage())); |
| 227 | } |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | /** |
| 232 | * create world tab |
no test coverage detected