How to set Focus to the first row in a JTable which is inside a JScrollPane

﹥>﹥吖頭↗ 提交于 2019-11-30 18:46:12
Luna

If you want to edit cell you can use,

jTable1.requestFocus();
jTable1.editCellAt(row,column);

Or else you want to just select the row, you can use,

jTable1.requestFocus();
jTable1.changeSelection(row,column,false, false);
  • try with myTable.changeSelection(row, column, false, false);

  • depends of ListSelectionModel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!