Exercise 9: Clocks

Exercise 9: Clocks 2015-12-04T17:55:55+00:00

[ Home | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 ]

The source code:

(Download the below file: Clock1.java)

The resulting applet:

 

Note that the time displayed in the lower left corner may not be correct — certain browsers (perhaps only older versions?) seem to interpret the “default” time zone as something different from the local time zone. (The hands, however, always seem to display the correct time.) If this problem bothers you, try using

timeString = date.toString();

instead of

timeString = formatter.format( date );