Programmatically select a row in JTable

后端 未结 3 1033
予麋鹿
予麋鹿 2020-12-24 10:37

When the application is started, none of the rows is selected. But I would like to show that the first row is already selected.

How to do this? Do I need to set the

3条回答
  •  死守一世寂寞
    2020-12-24 11:05

    You can do it calling setRowSelectionInterval :

    table.setRowSelectionInterval(0, 0);
    

    to select the first row.

提交回复
热议问题