Skip to main content

JXtable column moved, but keep the index ?

2 replies [Last post]
szd116
Offline
Joined: 2012-01-05
Points: 0

Hello everyone,
does anyone know if there is a way to keep the old index after the column is moved ? I have a table backed by an array of data, so once the column is moved and so is the index and it will screw up my data in the array.
So what I would like to happen is when user moves the columns around, the table would still use the old index. So user is merely moving the view not the data model. Please help.

Thank you

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
martinm1000
Offline
Joined: 2003-06-12
Points: 0

JXTable and the adapter used in Highlighters support methods convertRowIndexToModel / convertRowIndexToView. A search for these methods might help you figure out when to properly use them.

szd116
Offline
Joined: 2012-01-05
Points: 0

that was an easy one, thank you.