import java.awt.*; public class app2_thread extends Thread { applet2 app; public app2_thread(applet2 a) { super(); app = a; } public void run() { while (true) { if (app.check_stop()) { //System.out.println("In stop clause of run()"); app.state = 2; app.do_stop(); //Event evt = new Event(app.stop, Event.ACTION_EVENT, null); //app.deliverEvent(evt); break; } app.do_step(); try { sleep(250); } catch (InterruptedException e) {} } } }