Posted By:
Amar_Mattey
Posted On:
Monday, August 19, 2002 08:22 AM
To me it looks like when sorting is done the table rows are
falsed in the SortedTableModel and displayed.
2 things can be done here
1) If row number 2 needs to be deleted we need to say
tableModel.delete(index[2]) where index is the displced row
index.
2) Theoritically all the indexing should be hidden in the
table model itself so when we call delete we need to
use the index array which has the original row indexs to delete the rows.
Lets take your example
row originalIndex
dell 0
csco 1
msft 2
ibm 3
after sorting
row originalIndex displaying Index
csco 1 0
dell 0 1
ibm 3 2
msft 2 3
So when we call delete on dell we say deletItemAt(1) assuming displaying index is 1 but infact csco is the original item at index 1.
Hope this was helpfull.
Thanks.