These applet start and stop methods can always be used to start and stop the thread. |
import java.awt.*; |
import java.util.Date; |
public class DigitalClock extends java.applet.Applet |
implements Runnable |
{ Font theFont = new Font("TimesRoman", Font.BOLD, 24); |
Date theDate; |
Thread runner; |
public void start ( ) |
{ if (runner == null) |
{ runner = new Thread(this); runner.start ( ); } |
} |
public void stop ( ) |
{ if (runner != null) |
{ runner.stop ( ); runner = null; } |
} |