`

Swing Jtable 选择与反选

阅读更多
Swing 中设置jtable 行取消和选中常用如下:


//选中N-M行
table.setRowSelectionInterval(0, 0);//选中索引未0行
table..setRowSelectionInterval(0, 1);//选中索引0-1行

//追加选中
table.addRowSelectionInterval(1, 1);
table.addRowSelectionInterval(2, 2);

//取消选中
table.removeRowSelectionInterval(2, 2);

//选中所有
table.selectAll();

//取消所有
table.clearSelection();
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics