且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在JTable行中突出显示找到的数据

更新时间:2023-12-04 08:46:28

我们可以使用自定义JLabel和TableCellRenderer来实现. 下面的示例突出显示JTable中找到(过滤)的行.行通过RowFilter进行过滤: http://www.logicbig.com /tutorials/core-java-tutorial/swing/jtable-row-filter-highlighting/

We can achieve that with a custom JLabel and TableCellRenderer. Following example does the highlighting on the found (filtered) rows in JTable. The rows are filtered via RowFilter: http://www.logicbig.com/tutorials/core-java-tutorial/swing/jtable-row-filter-highlighting/