Problems with JTable sorting of integer values

前端 未结 6 1050
故里飘歌
故里飘歌 2020-12-21 10:44

Currently I have a JTable that uses RowSorter, but when I click the header that I want it to sort in, it displays the rows in a weird order

6条回答
  •  佛祖请我去吃肉
    2020-12-21 11:44

    To expand on @aaamos' answer, verify that your TableModel returns Number.class (or a suitable subclass) from getColumnClass(). There's a related example here.

提交回复
热议问题