public void goToBookmark(int viewRow) { if (viewRow == -1 || table.getRowCount() == 0) { return; } LocationController lc = LocationController.getInstance(); BookmarksTableModel tableModel = (BookmarksTableModel) table.getModel(); Bookmark bookmark = tableModel.getData().get(table.convertRowIndexToModel(viewRow)); lc.setLocation(bookmark.getReference(), (Range) bookmark.getRange()); }