void (TreeSelectionEvent e) { if (e.getSource() == myTree.getSelectionModel()) { int row = myTree.getRowForPath(myTree.getSelectionPath()); if (row >= 0) { myTable.setRowSelectionInterval(row, row); } else { myTable.clearSelection(); } } }