Create a Simple Applet in JAVA

  1. import java.awt.*;  
  2. import java.applet.*;  
  3. /*<applet code="Animate" width=800 height=600></applet> */  
  4. public class Animate extends Applet  
  5. {  
  6.     public void paint(Graphics g)  
  7.     {  
  8.         Image img = new getImage(getDocumentBase(), "Plain.gif");  
  9.         for (int x = 0; x < 800; x++)  
  10.         {  
  11.             g.drawImage(img, x, 0, null);  
  12.             try  
  13.             {  
  14.                 Thread.sleep(20);  
  15.             }  
  16.             catch (InterruptedException ie)  
  17.             {}  
  18.         }  
  19.     }  
  20. }