Back to the CodeBase homepage ClickClock Back to the CodeBase homepage






Apparently it's a requirement that every Java programmer must produce at least one clock, so here at last is mine. It does very little except tell the time, but hey, what do you want from a clock?

As you can see, you get a few parameters to play with. Both background and text colours are editable, along with fontname and fontsize. And, of course, the text auto-centers, so you can position it fairly precisely (allowing for the fact that we get days like Saturday and months like September which take up a bit more space than a Friday in May).

Oh, one more thing -- it's clickable. Click once to make it vanish, click again (if you can find it) to bring it back.


This is way too simple for proper documentation, so here are those parameters in full:


BgColor
The background color as a hex triplet. The default is 000000 (black).

TextColor
The color of the text as a hex triplet. The default is 00FF00 (lime).

FontName
The, uh, name of the font. As usual in Java applets, your choices are TimesRoman, Helvetica, Dialog, Courier and Symbol. The default font is TimesRoman.

FontSize
The size of the font. No, really. The default size is 18.


Don't forget to allow for those longer day and month names when judging the dimensions of the applet!


If you can control your excitement no longer, head along to the Download page to grab the class file and this page in a zip.



As with all my applets, ClickClock is free for non-commercial use only.
Commercial users weird enough to want this particular applet should register it.


Rob Young







.