posted 10 years ago
I'd like to keep the selected row visible whenever a JTable is sorted. I've tried to fix it in a RowSorterListener, but it seems like the listener is called BEFORE the table is sorted (table.getSelectedRow() returns the row which was selected before the sort). The attached example will hopefully show what I mean. If I select a row and then sort the table by clicking one of the column headers, the selected row will most likely disappear out of view.
Any suggestions?
Thanks.