Basic Technologies: There are many ways to achieve animations in Java, but the basic principles they achieve are the same, that is, draw a series of frames to create a feeling of motion on the screen. Let's construct a program framework, slowly expand, make it more complete. Use thread: For multiple update screens per second, you must create a thread to implement a loop of the animation, this loop to track the current frame and respond to periodic screen update requirements. There are two ways to implement threads, you can create a derived class of THREAD, or attached to the interface of Runnable. An easy-to-criminal error is to loop the animation in Paint (), which occupies the primary AWT thread, and the main thread will be responsible for all drawings and event processing. A frame applet follows: publicclass Animator1 extends java.applet.Applet implements Runnable {int frame; int delay; Thread animator; public void init () {String str = getParameter ( "fps"); int fps = (str = null!) INTEGER.PARSEINT (STR): 10; DELAY = (fps> 0)? (1000 / fps): 100;} public vois start () {Animator = new thread (this); Animator.Start ();} public void Run () {while (thread.currentthread () == Animator) {repaint (); try {thread.sleep (delay);} catch (interruptedException e) {botch;} frame ;}} public void stop ()}} public void stop ()}} = NULL;}} In your html file, this reference: