You will see that the animation is pretty smooth and you don't need any special tricks when drawing the frame. The only disadvantage is that you have to allocate an offscreen image that is as large as the drawing area. If the drawing area is very large, this may demand quite a lot of memory. Here is Example6Applet in action, followed by a code listing. This adds some minor complications to the problem.
Images are rather large and they are loaded incrementally.
It can take a long time for images to be fully drawn, especially when you are loading them over a slow connection. The image observer is an object that is notified when more of the image data has arrived. Here is Example7Applet in action, followed by a code listing. Displaying a sequence of images Example8Applet shows how to create an animation using separate images for each frame. The reason is that each image that we are rendering is partially transparent, and we therefore need to erase each frame before drawing the next.