[Menu]>[Java Programming]>[Production samples by JDK1.0]


Digital clock Applet





This applet is the applet that displays the clock on the image such as the photograph.
I began to study Java programming in order to make this applet.
This applet is being used also in the page of "Ultra High Accuracy Digital Clock"
where I am introducing in the different page.

Point of this applet be by using "Date" of the utility class to obtain time information,
is to take out and use the necessary part from the information that was obtained.
The waiting time in run method is being made 100 milli seconds
to raise the display accuracy of the clock.

The function is as follows.
Each font size( Size of the letter ) of Hour, Minute and Second
is possible designated separately.
Each figure of Hour, Minute and Second is able to be arranged
in the optional position inside the display area.
As the display of Hour and Minute, the red color is used for the morning,
the green color is used for the afternoon.
( Display color changes same as "Ultra High Accuracy Digital Clock" )

The following function is as fixation to avoid the complicatedness of input.
If the source program is changed, it is able to change.
The font type is fixing to Dialog.
In the case that there is not the designation of the image file
the backcolor is being done to black.
The color of the second display letter is fixing to red.
( Same as "Ultra High Accuracy Digital Clock" )

The size of DigitalClock.class becames 5.64KB.

Designated method in HTML

Source program list




The source program list can utilize by copying to notepad etc.

Copy method