How to use BillsClock2 on your website

When you unpack the distribution, you should find a number of files in the extracted folder, this file (HOW-TO.html) being one of them

  • *.au files - a variety of sound files from which you can customise the optional chimes.

  • *.jpg files - a few basic clock images in 300x300 and 150x150 format. (Note that GIF files are also supported, although we are using JPG's in our examples.)

  • billsclock2.jar - a java archive file that contains all the applet's classfiles in a fast-downloading, compressed format.

  • FAQ.html - an HTML file that contains some commonly asked questions and answers concerning BillsClock2

  • LICENSE.txt - By using this applet, you agree to the terms of the license. Please read the license agreement carefully.

Installation

  • Upload the file billsclock2.jar to your web directory. (Be sure to upload this file as  binary and not ascii.) This is a java archve containig all class files required by the applet in an efficient, compressed format. Do not unpack this jar file - it is intended to be used as-is.

  • If you want your clock to chime, choose the .au audio file(s) that you prefer and upload to the web directory that contains billsclock2.jar. The clock can optionally  chime on the hour and half-hour, and you can use the same or different audio file for the hour and half-hours. Just make sure that the .au files you configure the applet to use are in the web directory where the applet will be kept. Upload audio files as binary and not ascii. (Note that only .au format is supported.)

  • Pick the .jpg (or .gif) image that you want to use for your clock face. You can use those provided, or you can find/create your own. If you use your own image, you will probably have to make some minor changes in the sample HTML code to reflect the size of the clock if different, and dimensions/placement of the hands. GIF's are supported, in addition to JPG format. Both images and audio files should be uploaded (as binary rather than ascii) to the same web directory in which billsclock2.jar was saved.

  • Create an HTML page (or use an existing one) to display the applet. This HTML file should be placed in the same web directory that contains billsclock2.jar. Sample applet tags are provided below. Read the descriptions of the applet's parameters to see how you can tweak and configure the applet to accomodate your own images, sound files, time zones, etc.

Example HTML Tags

The following examples represent three typical installations.

Example One (300 x 300)

This example chimes on the hour and half-hour, displays the date and   AM/PM. See the applet parameter details for more information about configuring the applet.


Coordinated Universal Time

Here's what the above applet's HTML tags look like:

<applet code="BillsClock2" width="300"height="300">
	<param name="ARCHIVE" value="billsclock2.jar">
	<param name="BGIMAGE" value="24clock300.jpg">
	<param name="CENTERX" value="150">
	<param name="CENTERY" value="150">
	<param name="HOURCOLOR" value="#000000">
	<param name="MINUTECOLOR" value="#000000">
	<param name="SWEEPCOLOR" value="#ff0000">
	<param name="HOURLENGTH" value="60">
	<param name="HOURTHICK" value="7">
	<param name="MINUTELENGTH" value="100">
	<param name="MINUTETHICK" value="7">
	<param name="SHOWSWEEP" value="1">
	<param name="SWEEPLENGTH" value="100">
	<param name="FONTSIZE" value="12">
	<param name="USE_SNTP" value="0">
	<param name="SNTP_PORT" value="1200">
	<param name="SHOW_DATE" value="1">
	<param name="SHOW_AMPM" value="1">
	<param name="SNTP_SAMPLES" value="3">
	<param name="BGCOLOR" value="#ffffff">
	<param name="FGCOLOR" value="#000000">
	<param name="TIMEZONE" value="GMT">
	<param name="HOUR_CHIMES" value="bells.au">
	<param name="HALFHOUR_CHIMES" value="bells.au">
	<param name="SYNC_MESSAGE" value="Synchronizing...">
	<param name="VERBOSE" value=1>
</applet>

Example Two (150 x 150)

This applet does not chime, and does not display the date. It uses a smaller clock face. See the applet parameter details for further information on configuring this applet.


U.S. Eastern Time

<applet code="BillsClock2" width="150" height="150">
      <param name="ARCHIVE" value="billsclock2.jar">
      <param name="BGCOLOR" value="#ffffff">
      <param name="BGIMAGE" value="clock150.jpg">
      <param name="CENTERX" value="75">
      <param name="CENTERY" value="75">
      <param name="FGCOLOR" value="#000000">
      <param name="FONTSIZE" value="10">
      <param name="HOURCOLOR" value="#000000">
      <param name="HOURLENGTH" value="30">
      <param name="HOURTHICK" value="3">
      <param name="MINUTECOLOR" value="#ABA198">
      <param name="MINUTELENGTH" value="50">
      <param name="MINUTETHICK" value="3">
      <param name="SHOW_DATE" value="0">
      <param name="SHOW_AMPM" value="1">
      <param name="SHOWSWEEP" value="1">
      <param name="SNTP_PORT" value="1200">
      <param name="SNTP_SAMPLES" value="3">
      <param name="SWEEPCOLOR" value="#8D7F73">
      <param name="SWEEPLENGTH" value="50">
      <param name="TIMEZONE" value="EST">
      <param name="USE_SNTP" value="0">
      <param name="SYNC_MESSAGE" value="Stand by...">
      <param name="VERBOSE" value=0>    
</applet>

 

Example Three (300 x 300)

This example displays the date, but it does not chime. (One chimer per page is enough.) By not specifying a particular time zone, this applet will default to the timezone of the visitor's computer. See the applet parameter details for more information about configuring the applet.


Your Local Time

Here's what the above applet's HTML tags look like:

<applet code="BillsClock2" width="300"height="300">
	<param name="ARCHIVE" value="billsclock2.jar">
	<param name="BGIMAGE" value="clock300.jpg">
	<param name="CENTERX" value="150">
	<param name="CENTERY" value="150">
	<param name="HOURCOLOR" value="#000000">
	<param name="MINUTECOLOR" value="#ABA198">
	<param name="SWEEPCOLOR" value="#8D7F73">
	<param name="HOURLENGTH" value="60">
	<param name="HOURTHICK" value="7">
	<param name="MINUTELENGTH" value="100">
	<param name="MINUTETHICK" value="7">
	<param name="SHOWSWEEP" value="1">
	<param name="SWEEPLENGTH" value="100">
	<param name="FONTSIZE" value="12">
	<param name="USE_SNTP" value="0">
	<param name="SNTP_PORT" value="1200">
	<param name="SHOW_DATE" value="1">
        <param name="SHOW_AMPM" value="1">
	<param name="SNTP_SAMPLES" value="3">
	<param name="BGCOLOR" value="#ffffff">
	<param name="FGCOLOR" value="#000000">
	<param name="SYNC_MESSAGE" value="Synchronizing...">
	<param name="VERBOSE" value=0>
</applet>
 

Applet Parameter Details

The appearance and initial settings of the applet are controlled by HTML applet parameter tags.  In addition to height and width, the applet's other configurable parameters are depicted in the table below: If the default value is acceptable, the parameter can be omitted from the HTML. (Our examples have overspecified some defaults simply for the sake of showing how all parameters are used.)

Name

Type

Description

Default

BGCOLOR Hex RGB Triplet HTML-style Color designation for applet background. If the clock image is transparent, this is the color that will be visible. #FFFFFF (White)
FGCOLOR Hex RGB Triplet HTML-style Color designation for applet foreground #000000 (Black)
CENTERX Integer The X-Coordinate of the clock's hands origin point .5 x Width
CENTERY Integer The Y-Coordinate of the clock's hands origin point .5 x Height
FONTFACE String Name of font face for text display areas: Courier, TimesRoman, or Helvetica Helvetica
FONTSIZE Integer Size of date and/or AM PM test in pixels 9
SWEEPCOLOR Hex RGB Triplet HTML-style Color designation for applet's second hand #FF0000 (Red)
MINUTECOLOR Hex RGB Triplet HTML-style Color designation for applet's minute hand #c0c0c0 (Gray)
HOURCOLOR Hex RGB Triplet HTML-style Color designation for applet's hour hand #000000 (Black)
SYNC_MESSAGE String Brief message to display while the applet synchronizes with the SNTP server "Please stand by..."
BGIMAGE String Name of image file to display as the clock face None
TIMEZONE String 3-Char abbreviation of zone name (taken from the table of supported Time Zones) If this parameter is omitted, than the clock will display the browser's local time. None
HOUR_CHIMES String Optional audio file (.au format only) for on the hour chimes. Leave this parameter out if you do not want hourly chimes. None
HALFHOUR_CHIMES String Optional audio file (.au format only) for on the half-hour chimes. Leave this parameter out if you do not want half-hourly chimes.This can be the same or a different audio file than hourly chimes None
SHOWSWEEP Integer 1 will show a moving "second" hand or sweep hand. 0 will disable the sweep hand. 1 (Enabled)
HOURLENGTH Integer The length of the hour hand in pixels. 25
HOURTHICK Integer The width of the hour hand in pixels. 8
MINUTELENGTH Integer The length of the minute hand in pixels. 40
MINUTETHICK Integer The width of the minute hand in pixels. 6
SWEEPLENGTH Integer The length of the sweep hand in pixels 40
VERBOSE Integer 1 - Display informational messages in the Java Console. 0 - Do not display general information in the Java Console. 1 (Enabled)
*USE_SNTP Integer 0 - disable SNTP synchronization. 1 enables SNTP 0 (SNTP Disabled)
SNTP_PORT Integer Port on which the SNTP Proxy app listens on the home server to relay packets to the actual NTP server 1200
SNTP_SAMPLES Integer The maximum number of SNTP connections to calculate a mean 4
* Do not enable SNTP if you are not running the server-side components needed for it to work. These are commercially licensed components that cannot be redistributed with this applet. It will not hurt anything if you enable it, but the applet will not synchronize, and this may delay the initiallization of the applet.

Supported Time Zones

The following time zones are supported by JDK 1.1.8 (and as implemented in Netscape version 4.x and all versions of MS Internet Explorer 4.x or later)

Zone ID Zone Name Offset Uses Daylight Time
GMT Greenwich Mean Time 0 false
UTC GMT+00:00 0 false
ECT Central European Standard Time 60 true
EET GMT+02:00 120 true
ART GMT+02:00 120 true
EAT GMT+03:00 180 false
MET GMT+03:30 210 true
NET GMT+04:00 240 false
PLT GMT+05:00 300 false
IST GMT+05:30 330 false
BST GMT+06:00 360 false
VST GMT+07:00 420 false
CTT China Standard Time 480 false
JST Japan Standard Time 540 false
ACT GMT+09:30 570 false
AET GMT+11:00 600 true
SST GMT+11:00 660 false
NST GMT+12:00 720 true
MIT GMT-11:00 -660 false
HST Hawaii Standard Time -600 false
AST Alaska Standard Time -540 true
PST Pacific Standard Time -480 true
PNT Mountain Standard Time -420 false
MST Mountain Standard Time -420 true
CST Central Standard Time -360 true
EST Eastern Standard Time -300 true
IET Eastern Standard Time -300 false
PRT GMT-04:00 -240 false
CNT Newfoundland Standard Time -210 true
AGT GMT-03:00 -180 false
BET GMT-02:00 -180 true
CAT GMT-01:00 -60 false
Note: We have not tested the applet with all time zones, however these are documented as supported by JavaSoft.

Copyright (C) 2001 by Bill Giel. All rights reserved.