我改变了TableCell的BackGround之后,为什么没有马上生效?

xxisxx 2003-09-22 11:31:02
Component testcell= (Component)m_table.getCellRenderer(2,2);
System.out.println("before  " + testcell.getBackground());
if(testcell.getBackground().equals(Color.black)){
testcell.setBackground(Color.red);
} else {
testcell.setBackground(Color.black);
}
m_table.repaint();
System.out.println("after  " + testcell.getBackground());
}
Background 的值肯定是改变了,可使画面上没有效果,这是为什么呢?
我这么做,是让cell的又闪烁的效果,这段代码,在一个Thread里面循环做的,可是没有用,请赐教,谢谢
...全文
30 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
xxisxx 2003-09-22
  • 打赏
  • 举报
回复
自己推

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧