Reputation: 19432
On a JTable, I can select a specific row by using table.setRowSelectionInterval(rowIndex, rowIndex)
.
Now what I would like to do is the following:
I already made a method inside my tableModel called getElementRowIndex
that returns the model index of the element I'm passing on to it. But now I can't select that row because the table is filtered using a RowFilter and so many of my RowIndexes are off or out of bounds.
I can get the current model index for a selected row by using table.convertRowIndexToModel
. But what I need is something like table.convertModelIndexToRow
. Is there such a thing? How can I accomplish my goal?
Upvotes: 2
Views: 469