public void openSpreadsheet(Path file) { try { setSpreadsheet(mPersistenceManager.readSpreadsheetFromFile(file)); setCurrentFile(file); } catch (IOException e) { JOptionPane.showMessageDialog( this, e.toString(), "Failed to open document", JOptionPane.ERROR_MESSAGE); } }