The body of the applet is in the run method, in this case a loop to keep showing the date. |
public void run ( ) |
{ while (true) |
{ theDate = new Date ( ); |
repaint ( ); |
try { Thread.sleep ( 1000); } |
catch ( InterruptedExecution e) { } |
} |
} |
public void paint ( Graphics g ) |
{ g.setFont ( theFont ); |
g.drawString ( theDate.toString ( ), 10, 50 ); |
} |
} |