FileDocCategorySizeDatePackage
GUIClock.javaAPI DocExample685Tue Dec 12 18:58:10 GMT 2000None

GUIClock

public class GUIClock extends Applet implements Sleeper

Fields Summary
private AlarmClock
clock
Constructors Summary
Methods Summary
public voidinit()

        clock = new AlarmClock();
    
public voidpaint(java.awt.Graphics g)

        Calendar cal = Calendar.getInstance();
        Date date = cal.getTime();
        DateFormat dateFormatter = DateFormat.getTimeInstance();
        g.drawString(dateFormatter.format(date), 5, 10);
    
public voidstart()

        clock.letMeSleepFor(this, ONE_SECOND);
    
public voidwakeUp()

        repaint();
        clock.letMeSleepFor(this, ONE_SECOND);