Methods Summary |
---|
public void | paint(java.awt.Graphics g)Display the time.
date.setTime(System.currentTimeMillis());
g.drawString(format.format(date), 2, 10);
|
public void | run()Show the time, and wait a while.
while (timerThread != null) {
repaint(); // request a redraw
try {
timerThread.sleep(1000);
} catch (InterruptedException e){ /* do nothing*/ }
}
|
public void | start()
/* Applet Lifestyle Methods */
timerThread = new Thread(this, "Clock");
timerThread.start();
|
public void | stop()
if (timerThread == null)
return;
timerThread = null;
|