Multiple row selection in JTable

后端 未结 4 1803
余生分开走
余生分开走 2020-11-22 07:53

I have a JTable, that has one column that is text which is not editable and the second column is a check box that displays boolean values.... Now what i want is, when the us

4条回答
  •  一整个雨季
    2020-11-22 08:22

    The problem is that when you click on a check box to change the value of the check box, the selection of all the rows will be lost. So you may need to use a right mouse click to display a popup menu that contains select/deselect values.

    Then you can use table.getSelectedRows(), to get the indexes of all the selected rows you need to update.

提交回复
热议问题