Updating JTable cell after sorting by column
When i update a cell data of JTable after sorting it by one column, though the data gets updated but it does not remain sorted and the data appears back as it appeared for the first time. How can i ensure that the data table structure does not change once i update a cell apart from the cell which i have updated.
Thanks,
Santosh
# 1
> and the data appears back as it appeared for the first time
Then you are doing something wrong. Using the setValueAt(...) method will not cause the entire table to be sorted. It should however sort the row into its proper position.
> How can i ensure that the data table structure does not change
It should not change unless you are firing the tableDataStructureChanged event, which is totally unnecessary.