/* Daniel Wyszynski Center for Applied Large-Scale Computing (CALC) 04-12-95 Test of text animation. kwalrath: Changed string; added thread suspension. 5-9-95 */ import java.awt.Graphics; import java.awt.Font; public class NervousText extends java.applet.Applet implements Runnable { protected char separated[]; protected String s = null; Thread killme = null; int i; int x_coord = 0, y_coord = 0; String num; int speed=35; int counter =0; boolean threadSuspended = false; //added by kwalrath public void init() { s = getParameter("text"); if (s == null) { s = "HotJava"; } separated = new char [s.length()]; s.getChars(0,s.length(),separated,0); // resize(150,50); setFont(new Font("TimesRoman",Font.BOLD,36)); } public void start() { if(killme == null) { killme = new Thread(this); killme.start(); } } public void stop() { killme = null; } public void run() { while (killme != null) { try {Thread.sleep(100);} catch (InterruptedException e){} repaint(); } killme = null; } public void paint(Graphics g) { for(i=0;i= myColours.length) {i = 0;} myApplet.setColour (myColours[i]); try { sleep((int)(Math.random() * 9000)); } catch (InterruptedException e) {} } //while System.out.println("DONE! " + getName()); } //run } //end class ColourThread