Is there a better method for getting notified of changes in the row selected in a JTable than listening for mouse events and checking to see if the row selected has changed?
table.addMouseListener(new MouseAdapter() {
public void mouseReleased(MouseEvent e) {
//do something with table.getSelectedRow() or table.getSelectedRows()
}
});Both adding a TableColumnModelListener to the table's column model and adding a ListSelectionListener to that model's selection model only give access to the event of a change in the column selected, not in the row selected, as far as I can tell. What is a better method than using a mouse listener for getting notified of changes in the row or rows selected in a JTable?