import java.awt.*; import java.applet.*; public class HelloWorldApplet extends Applet implements Runnable { private String s = " "; Thread animationThread = null; public void init() { resize(150, 25); } public void start() { animationThread = new Thread(this); animationThread.start(); } public void run() { for(int i=1; i<10; i++) { s = "---"; repaint(); try{ animationThread.sleep(100); }catch(InterruptedException e){ } s = "!!!"; repaint(); try{ animationThread.sleep(100); }catch(InterruptedException e){ } } } public void paint(Graphics g) { g.drawString("Hello World" + s, 50, 25); } } /* L.Allison, Department of Computer Science, Monash University */