Multipage JTable: impossible to display less items than rows

前端 未结 3 1929
鱼传尺愫
鱼传尺愫 2021-01-27 12:18

I realized a JTable with a custom AbstractTableModel for implementing paging. I wanna show 5 item per page, but I\'ve a problem: if I have N item to show (with N wh

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-27 12:52

    Make sure your model's getRowCount method is inline with what you want it to do. The getRowCount method should return an acceptable number for your table, so that it doesn't call getValueAt for any rows that don't exist. So, if you have no row 14, your row count shouldn't be that high.

提交回复
热议问题