• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java2D and Animation  RSS feed

Christopher Arthur
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since from reading I've found different approaches to doing animation with Java2D, I thought I'd ask here before embarking on a new project.

Suppose you want to use either circles and lines, or bitmaps to make a simple animation, and you want to be sure that swing performs it faithfully without artifacts or lags. So naively, you instantiate a jpanel and override its paint method with something clever to draw any frame of the animation. Also, you have a good idea of how it should look and when its going to change, so you set a thread looping and waiting for signals to tell the jpanel to repaint itself.

Does this seem like the best approach?

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!