In a Java applet, to get the appearance of motion, you continually draw on the canvas with a new picture. |
Some animations consist of a sequence of images, where each one differs a little from the previous one. Here you just keep calling drawImage, and the new Image covers up the old one. |
A graphics animation repaints with a new set of graphics shapes or objects. This leads to a loop that keeps calling repaint, which will call paint. Each time paint is called, it should draw a picture with the objects in new locations. |