How to Keep Track of row index when JTable has been sorted by the user?

前端 未结 3 1142
借酒劲吻你
借酒劲吻你 2021-01-11 15:38

I have a JTable which has 1st row blank. Now when I sort the table based on a column by clicking on that column then the blank row goes at the bottom. If I insert something

3条回答
  •  梦毁少年i
    2021-01-11 15:47

    JTable.convertRowIndexToView() will return you an index of the row in the view based on its index in the model. JTable.convertRowIndexToModel() will do the opposite.

提交回复
热议问题