I have a JTable to which I linked a DefaultTableModel and a TableRowSorter. They work. When you click in a row, its content is copied to JTextfields so you can edit them*. But if you sort the table by some field and then click in a row, the copied content is taken from its previous value (before the sort) instead from the new one. What can be causing this?
*I do this because the table only contains a subset of all fields.
Looks like when you are getting the selected row index you are not converting it to the model index before you grab the data.
Instead of this:
Use this: