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


Analog/Digital clock Applet





This applet reconstructs "Digital clock Applet"
that I am introducing in the different page and even the analog clock is displaying.

Math.sin and also Math.cos of the trigonometrical function are being used
to get the position where this applet displays the hand of the clock.
And
the Polygon display is being used to display the long hand and the short hand.

The function is as follows.
The designation of the image file is produced.

<Digital clock regarding>
Whether it displays or not is possible designated.
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" )

<Analog clock regarding>
Whether it displays or not is possible designated.
The position where displays is possible designated.
The size of the clock is possible designated.

The following function is as fixation to avoid the complicatedness of input.
If the source program is changed, it is able to change.
In the case that there is not the designation of the image file
the backcolor is being done to black.

<Digital clock regarding>
The font type is fixing to Dialog.
The color of the second display letter is fixing to red.
( Same as "Ultra High Accuracy Digital Clock" )

<Analog clock regarding>
The color and form of
Dial plate, Short hand, Long hand, Second hand, Center dot
are making fixation.

The size of AD_Clock.class becames 7.30KB.

Designated method in HTML

Source program list





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

Copy method