Exemplo n.º 1
0
  private static void saveBookmarks(JTable table) {
    BookmarksTableModel btm = (BookmarksTableModel) table.getModel();
    List<Bookmark> bookmarks = btm.getData();

    // get the path (null if none selected)
    File selectedFile = DialogUtils.chooseFileForSave("Save Bookmarks", "Bookmarks.txt");

    // set the genome
    if (selectedFile != null) {
      try {
        saveBookmarks(selectedFile.getAbsolutePath(), bookmarks);
      } catch (IOException ex) {
        DialogUtils.displayError("Error", "Unable to save bookmarks: " + ex.getMessage());
      }
    }
  }