Re: How to implement JPane that is animating



"jb" <jbzdak@xxxxxxxxx> writes:

Well I admit - its a homework ;-).
I have to animate sth on a JPane, but I don't know how.
My current implementation is: to check in paint method whether some
defined time interval has passed, if so switch to next "Frame", and in
separate thread object repaint this pane often.

But if this thread has big priority GUI is not responsive, if low it
gets CPU time very rarely every so 3-4 seconds! While I need intervals
of 100ms.

Is there a better way of doing it?

Consider using Timers to control the change of what it is you are
drawing.

--
Thomas A. Russ, USC/Information Sciences Institute













.