【发布时间】:2014-07-29 00:05:24
【问题描述】:
我想在找到数据时从JTable 搜索数据,然后我想突出显示表格行。此代码可以正常工作搜索记录,但我不知道我为突出显示该行做了什么。
String target = jTextField1.getText();
for(int row = 0; row < jTable1.getRowCount(); row++)
for(int col = 0; col < jTable1.getColumnCount(); col++)
{
String next = (String)jTable1.getValueAt(row, col);
if(next.equals(target))
{
System.out.println("found");// here what change for highlight row.
}
}
【问题讨论】:
-
“我想从jtable中搜索数据..”见
JTable: Sorting and Filtering。
标签: java swing jtable filtering tablerowsorter