azsx said:
Hi. Can you give me an example of drawing some simple animation on a
static image? Let's say that a red circle has to move over the
background image, can you help?
You usually a completely opaque background, so that the previous frame
has no effect on the appearance of the next frame. Draw the background,
which effectively wipes out all trace of the previous frame, and then draw
your red circle. Drawing from back-to-front like this is known as "Painters
Algorithm".
Do I need to do this with threads?
Whenever you use a GUI like AWT or Swing, they will use threads behind
the scenes. However, you do not need to explicitly create any threads over
the ones that AWT/Swing creates for you, if all you want to do is draw some
animations.
- Oliver