JTable looses after sort the current selection
I have a JTable with either a RowSorter or setAutoCreateRowSorter(true) These tables have attached as well a ListSelectionListeners. When I click on the Header to sort the JTable, the table is sorted, but the selection remains in the same row (after the sort). There is as well no ListSelectionEvent which is quite strange.
The problem occurs mainly when I am at the top resp. at the bottom of my Table. When I change the selection afterwards, the content is fine. But I want that the selection keeps track of the sorted-status and therefore the selection should be displayed properly...
Did have anyone similar experiences with incorrect selections? Do I really have to add some additional MouseListeners to the Header (if this would fix the problem)?