1 | These applet start and stop methods can always be used to start and stop the thread. |
2 | import java.awt.*; |
3 | import java.util.Date; |
4 | public class DigitalClock extends java.applet.Applet |
5 | implements Runnable |
6 | { Font theFont = new Font("TimesRoman", Font.BOLD, 24); |
7 | Date theDate; |
8 | Thread runner; |
9 | public void start ( ) |
10 | { if (runner == null) |
11 | { runner = new Thread(this); runner.start ( ); } |
12 | } |
13 | public void stop ( ) |
14 | { if (runner != null) |
15 | { runner.stop ( ); runner = null; } |
16 | } |