I need to create a table that can be sorted by clicking the table header AND, translating individual and several rows manually.
I made a few buttons to move the selected rows in the table model up, down, up, or down. These buttons modify the table model and then update the JTable. That alone works great.
But when I start sorting the rows by clicking on the columns in the table header, everything goes wrong. Manual sorting works with the collection in the table model, sorting by clicking on the header works with some kind of table view.
Is there a way to move rows manually only as a table, and not in a collection of table models? Or is there another better solution?
source
share