You should try ListSelectionListener. It never fails keeping track of all changes. This codeexample (not tested) should constantly keep currentRow up-to-date with current row in the table.
JTable myTable = new JTable();
ListSelectionModel lsm;
int currentRow = -1;
int prevRow = -1;
public...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.