Sorting Data

Top  Previous  Next

 

You can add sorting capabilities to a table by using SortTableModel. SortTableModel is a ListTableMap that transforms the underlying 'unsorted data' into a sorted data set. The sorting is performed by comparing the data with the help of Comparators. The user can sort the data by clicking on a column of the table's header. SortTableModel also installs a special renderer on the table's header so that to display the sorting order and to paint the mouse clicks on the header accordingly.