There is JTable, and one of columns has Date format. I need to sort table entries according to this column (Date).
To solve this task, I created a class TableSorter (http://docs.oracle.com/javase/tutorial/uiswing/examples/components/TableSorterDemoProject/src/components/TableSorter.java). Then I added the following lines in the code:
TableSorter sorter = new TableSorter(tableModel);
sorter.setTableHeader(table.getTableHeader());
When I run the program, I can see only small triagles added to headers, but ordering does not work.
Any ideas?
you have to add
TableSorterto theTableModelas is described in the JTables tutorial about Sorting and Filtering