The applet below demonstrates using threads and off screen buffering for animation.
Animation Example