CISC 181 Introduction to Computer Science, Fall, 1998

Programming Project - A Clock Applet.

  1. First things first. In today's lab, at least do this: Finish and submit your Clock prototype with working hour, minute, and second hands.
  2. Then begin work on the clock applet project. There are Basic and Delux features to this assignment. Next Monday, Oct 12 in lab, submit java code for a clock meeting the Basic specification. In that lab we will work on web page design.
  3. On Monday, Oct 19 in lab, submit a final Delux clock with associated web page.

Clock Applet Basic Specifications

Write a Clock applet whose paint method draws a clock with animated hands. The clock should have three properly working hands, showing hour, minute, second. The hands should advance at the proper interval. For testing purposes the applet should exploit an integer parameter "SPEED" in the applet tag. The clock should then run at a rate that moves the second hand SPEED seconds per actual second. The Basic specification also calls for a multicolored design for the cabinet and clock face and clock hands. This is to exercise the use of drawPolygon and/or fillPolygon, and the use of custom colors. To meet this specification you must
  1. Use at least 10 colors in your design, of which at least 5 are custom specified from R,G,B values.
  2. Create clock hands which are more than just line segments. Each hand can be a polygon or a combination of polygons and ovals, for example.
  3. Design a colorful clock face and "cabinet". In otherwords, make the background for your animated hands be something colorful and at least moderately complex geometrically.

Clock Applet Delux Specifications

Your final clock must include buttons with which the user can set the clock. We will be discussing graphical user interface, GUI, this week. Probable implementation. Puch hour button to advance hour by one, (by one per second while button held down), similarly, push minute button to set minute. Also, Your final clock, to be labeled Delux, must incorporate at least one of the following features. We plan to create a page off the course web page containing an assemblage of your clocks, all running. Be prepared to provide an applet tag for that, which sets your favorite values of any parameters you may be using.