Reputation: 23
Does anyone know how I would select a row in one JTable
and then it would highlight a row in another JTable
?
ListSelectionListener[] listeners = leftJTable.getListeners(ListSelectionListener.class);
Upvotes: 1
Views: 121
Reputation: 205855
Yes, two tables can share the same ListSelectionModel
:
JTable left = new JTable(...);
JTable right = new JTable(...);
right.setSelectionModel(left.getSelectionModel());
Upvotes: 1