Java: Countdown

Java applets are actually files external to your web page. You run the applet from your page, and configure the parameters for the application in the HTML code of your page, but the actual bits that do the work are external to your web page.

In this case, there's a file called icltimer.class that is the Java applet. It's in the review directory (it's best to keep the applet in the same directory as the web page). We're going to insert this applet at the top of the Milton Review home page.

Open up the Milton Review page in Notepad, and go to the bottom of the HTML code. We're going to insert this applet beneath the Books Received and Books Reviewed links.

Next, take a look at countdown.txt, which contains the parameters we need to paste into the Milton Review page to make the applet work. Copy these parameters to your clipboard and paste them into the Milton Review HTML page just beneath the links for Books Received and Books Reviewed.

Once you've pasted the code, take a look at what's there. The first line tells the web browser where to find the java applet and how big the applet should be.

Next you'll see a number of parameters. Here's what they do:

  1. ledcolor: this controls the color of the font for the timer
  2. backcolor: this controls the color of the background
  3. framecolor: this controls the color of the frames that make up the counter
  4. days-digits: I'm not sure what this controls. I've changed the number with no effect.
  5. year: tells the applet the target year. From the looks of it, this applet is not Y2K compliant!
  6. month: tells the applet the target month. Be careful! This applet sees January as month 0. In this example the value of 4 means May.
  7. date: tells the applet the target date. Be careful! This applet sees the first of the month a day 0. In this example the value of 9 means the 10th.
  8. hour: I'm a little stumped here, but this value controls the time of day. By setting my computer's date to the target date and checking it against the countdown applet, I've learned that 19 equals 2 PM. Go figure.
  9. minute, second and language value are all set to zero (I'm not sure how the language variable works, but you could set the timer for 2:30 PM or 2:30.34 if you wanted.
  10. HREF: tells the applet where to send the user should they click on the applet.
  11. title: this shows across the top of the applet as it runs. You don't have to make this a countdown to graduation if you don't want to.

Save the HTML page and reload the Milton Review page in your browser. The applet should be counting down just beneath the two links.

As you can tell, the parameters here are not intuitive. I suspect that the kind soul who built the applet understood what he or she was doing and that was good enough. I'm sure if you bought a Java applet it would be easier to configure, but trial and error can work.


H O M E B A C K