Reputation: 2753
I want to do animation in Java. I have looked at: http://docs.oracle.com/javase/tutorial/uiswing/misc/timer.html
What I'm surprised by is that in the timer action handler:
This seems somewhat odd to me because:
Question: am I mis reading the sample code, or is this the "correct" way to do animation in Java?
Thanks!
Upvotes: 2
Views: 481
Reputation: 1405
You might want to try Trident. Its a clean and simple animation library without a lot of bells and whistles and makes your life a LOT easier if your trying to do animations in Swing.
Upvotes: 0
Reputation: 23035
In case of "Animation", JavaFX is way better than Java, because it is built mainly for this purpose
Upvotes: 2
Reputation: 106401
It's fairly normal to do the state updates and rendering separately.
Java/Swing is pretty normal in this regard.
Reasons:
Upvotes: 5