I need a way to draw attention to particular cells in a large JTable (20×16!), and I want to know what it would take for the text to blink, e.g. 900msec on and 100msec off.
(I’m familiar with the concept of a TableCellRenderer)
Is there a way to do this just for the cells in question, without causing all the cells to redraw?
The required duty cycle (900 ms on, 100 ms off) and count (20 x 16) is well within the capability of
JTablerendering, 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 theprepareRenderer()approach.Addendum: Also consider a
GridLayoutofJLabel, with each button having it’s own instance ofjavax.swing.Timerto avoid synchronous blinking. The timers share a common thread.