A SwingWorker and javax.swing.Timer issue?
796293Jun 8 2009 — edited Jul 8 2009Hi All,
I was looking for some programming advice on what's the best way to deal with this problem. I have a SwingWorker that executes a system task that can vary quite widely in execution time. Also I have javax.swing.Timers that calls methods for animating the front-end of a GUI.
Now when the SwingWorker kicks off it will, during its lifecycle it will make various calls to these 'animation Timers' updating the front-end on the progress of the SwingTimer.
Now heres the problem, while the animations have fixed time delays to enable smooth animations, it is possible for the swingWorker to make a call to an animation timer, complete its task before the animation timer completes and make another call to the animation timer. This results in the animation graphics becomming flickery as two timers are running concurrently. Is there a good method of preventing timing issues like this?
Thanks!