2

i have a problem with JTable and setAutoCreateRowSorter(true); when I sort some column, the index table stays but order of row is different. How can i refresh my AbstractTableModel and keeping my sort.

1
  • beware: you are not supposed to do anything with your model! The very bone of Swing sorting mechanism is that there are two coordinate systems (one on your model, the other on your view). The table (more specifically: its RowSorter) keeps the mapping between both, then your application code uses the conversion methods to get hold of a particular value. Commented Dec 5, 2011 at 14:54

1 Answer 1

2

not clear from your question, propably you have to set int modelRow = convertRowIndexToModel(row);

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.