/** * Set the current selection to this row. * * @param rowno index into rowList */ public void setSelectedRow(int rowno) { if ((rowno < 0) || (rowno >= model.getRowCount())) return; if (debugSetPath) System.out.println("TreeTableSorted setSelected " + rowno); selectedRow = model.getRow(rowno); TreePath path = model.getPath(selectedRow); if (path != null) table.setSelectionPath(path); // for mysterious reasons, gotta do it again later invokeSetPath(); ensureRowIsVisible(rowno); }
/** * Get the currently selected row. * * @return selected TableRow */ public TableRow getSelectedRow() { return model.getRow(table.getSelectionPath()); }
public TableRow getRow(int row) { return model.getRow(table.getPathForRow(row)); }