private List<Node> getSelectedNodes() { List<Node> selectedNodes = new Vector<Node>(); NodeStatusTableModel myTableModel = (NodeStatusTableModel) getModel(); ListSelectionModel lsm = getSelectionModel(); int minIndex = lsm.getMinSelectionIndex(); int maxIndex = lsm.getMaxSelectionIndex(); for (int i = minIndex; i <= maxIndex; i++) { if (lsm.isSelectedIndex(i)) { // System.out.println("row " + i + " is selected"); Node currNode = myTableModel.getNode(i); if (currNode != null) selectedNodes.add(currNode); } } return selectedNodes; }
public void update() { model.updateAll(); }