首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

jtable选中拇指定的行和选中事件监听

2012-11-08 
jtable选中指定的行和选中事件监听选中行table.getSelectionModel().setSelectionInterval(startRowIndex,

jtable选中指定的行和选中事件监听
选中行
table.getSelectionModel().setSelectionInterval(startRowIndex, endRowIndex);

监听选择事件

table.getSelectionModel().addListSelectionListener(new ListSelectionListener(){@Overridepublic void valueChanged(ListSelectionEvent e){int row = table.getSelectedRow();if(row != -1){XXXModel model = (XXXModel)tbEmpList.getModel();}}});

热点排行