Swing: most computationally-efficient way to blink particular cells in a table

爷,独闯天下 提交于 2019-12-01 21:16:01
trashgod

The required duty cycle (900 ms on, 100 ms off) and count (20 x 16) is well within the capability of JTable rendering, which uses the flyweight pattern for efficiency. On the rare occasion when profiling warrants, see the article Christmas Tree Applications. See also this comparison with the prepareRenderer() approach.

Addendum: Also consider a GridLayout of JLabel, with each button having it's own instance of javax.swing.Timer to avoid synchronous blinking. The timers share a common thread.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!