Applets need to extend the Applet class. Thus they cannot also extend the Thread class but must implement the Runnable interface.
Thread engine = null;
public void start() { if (engine == null) { engine = new Thread(this); engine.start(); } } public void stop() { if (engine != null && engine.isAlive()) { engine.stop(); } engine = null; }