Hi All,
Here is an interesting example of a thread being
used to make a clock.
L8R!
- DL
import java.awt.*;
public class PoorMansThread extends Frame {
PoorMansThread() {
setSize(200,200);
setVisible(true);
}
public void paint(Graphics g) {
g.drawString((new java.util.Date()).toString(),
50,50);
repaint(1000);
}
public static void main(String args[]) {
new PoorMansThread();
}
}
|