我正在使用此处和此处的 Glazed List 教程,但这意味着您需要一个比较器来对行进行排序。但是,我似乎无法弄清楚如何添加对基于表头点击的排序的支持。
问问题
291 次
1 回答
1
经过更多的尝试和错误,我发现我做错了什么。
EventTableModel
必须用实例实例化,而SortedList
不是EventList
. 从例子:
private EventList<Issue> issuesEventList = new BasicEventList<Issue>();
...
SortedList<Issue> sortedIssues = new SortedList<Issue>(issuesEventList, null);
// create a panel with a table
JPanel panel = new JPanel();
// be careful not to put issuesEventList in here, it has to be the sortedIssues list
EventTableModel<Issue> issuesTableModel = new EventTableModel<Issue>(sortedIssues, new IssueTableFormat());
于 2012-05-03T16:15:48.883 回答