Reputation: 2076
This is my GUI. I basically want the records in the JTable to be in ascending order of date.
Can you please give an idea how to do this?
Upvotes: 0
Views: 515
Reputation: 683
Alternatively this works as well:
JTable.getRowSorter().toggleSortOrder(index);
index refers to the index of the column you want to arrange the records as of.
Upvotes: 1
Reputation: 5048
Try to see this example, I think it may help you http://www.java2s.com/Tutorial/Java/0240__Swing/SampleSortingTableModel.htm
Upvotes: 1