当用户按下 JButton 时,如何 "go to" JTable 中的特定行?

How can I "go to" a specific row in a JTable when user press a JButton?

大家好,我是一个使用 java.swing 的新手,我想知道您是否可以帮助我解决以下问题:

所以我的观点是,我想使用一个 JButton 将我带到睫毛和我具有最大值的行。

例如:如果最大值在睫毛 3 中,第 55 行,我希望在按下按钮时程序让我可视化这一行。

提前致谢。

例如您想要 select 行 x

Rectangle rect = myTable.getCellRect(x, 0, true);
myTable.scrollRectToVisible(rect); // scroll to the row
myTable.getSelectionModel().setSelectionInterval(x, x); // and select it (when required)