gpt4 book ai didi

java - JTable RowFilter 显示错误的行

转载 作者:行者123 更新时间:2023-12-01 12:05:39 25 4
gpt4 key购买 nike

我正在使用扩展 RowFilter 的自定义类来根据列中的 boolean 值过滤我的表

public class MyRowFilter extends RowFilter<Object, Integer> {

@Override
public boolean include(Entry entry) {

return (boolean) entry.getValue(0));
}
}

我将它分配给表格

TableRowSorter<TableModel> tableRowSorter = new TableRowSorter();
myRowFilter = new MyRowFilter(myTableModel);
tableRowSorter.setRowFilter(myRowFilter);
myTable.setRowSorter(platformTableRowSorter);

但是我在表单上得到的只是 myTable 的前 N(include() 返回 true 的时间)行,而不是 include() 返回 true 的行。

什么会导致这种行为?

最佳答案

String table_event = table_job.getModel().getValueAt(table_job.
convertRowIndexToModel(row), 0).toString());

关于java - JTable RowFilter 显示错误的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27646038/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com