为什么我的JTable CellRenderer一直在运行?
//新手问题
我有一个带有几乎基本的单元格渲染器的JTable(它以不同的方式为线条着色)。
我注意到我的单元格渲染器一直在运行显示在屏幕上的线条,即使我对表格没有任何操作。
这是怎么回事?它不应该一次渲染每个细胞,就是这样吗?
我怎样才能让它停止,只在重新计算时重新计算?
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
log.debug("Building cell : " + row + "," + column);
Component comp = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
Filter filter = (Filter)table.getModel().getValueAt(row, Column.CLASSIFICATION.getIndex());
comp.setBackground(filter.getColor());
return comp;
}
没有找到相关结果
已邀请:
4 个回复
宦哨抹存胳
甲车劲
我有这条线:
并且它不断改变行线,而同一行中的其他渲染器也做了相同的... 所以他们不断互相开火。
捻盒愧杯
呈辖玫割善