这是我的GUI。我基本上希望JTable中的记录按日期的升序排列。
你能问一下如何做到这一点吗?
答案 0 :(得分:1)
试着看看这个例子,我想它可能对你有帮助 http://www.java2s.com/Tutorial/Java/0240__Swing/SampleSortingTableModel.htm
答案 1 :(得分:1)
或者这也适用:
JTable.getRowSorter()toggleSortOrder(的索引强>);
索引是指您要将记录排列为的列的索引。