
import java.applet.Applet;
import java.awt.*;

public class ImageAnim extends Applet implements Runnable
  {
    Image[] images;
    int num_images = 4;
    Thread my_thread = null;

    public void init()
      {
	images = new Image[num_images];

	for (int i=0; i<num_images; i++)
		{
		images[i] = getImage(getCodeBase(), "./images/ANIM" + i + ".GIF");
		}
      }

    public void start()
      {
        my_thread = new Thread(this);
        my_thread.start();
      }

    public void run()
      {
        while(true) {
		for (int i=0; i<num_images; i++) {
	    		getGraphics().drawImage(images[i], 0, 0, this);

            		try {
                		Thread.sleep(600);
              		}
            		catch(InterruptedException e) {
              		}
		}
        }
      }

  }

