java - Sorting JTable Rows manually and with TableRowSorter simultaneously -


i have create table can sorted clicking on table header , reordering single , multiple rows hand.

i made buttons move selected rows in table model up, down, top or bottom. buttons alter table model , afterwards update jtable. alone works fine.

but when start sorting rows clicking on columns in table header goes wrong. manual sorting works collection in table model, sorting clicking header works kind of table view.

is there way move rows manually in table view , not in table models collection? or there other better solution?

the jtable api addresses relationship between model , view co-ordinates respect sorting. in particular, says, "in examples area, there demonstration of sorting algorithm making use of technique interpose yet coordinate system order of rows changed, rather order of columns." might compare you're doing relevant example in sorting , filtering.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -