Assignment 1: Analog Clock
Due 2/14
Purpose
The purpose of this program is to gain familiarity with Java's 2D graphics
drawing facilities.
The Problem
You must develop an analog clock to display the current time as shown here.
The requirements of the project are:
- The clock should start with the current time and keep ticking.
- Display the time on the clock with the form of hh:mm:ss (e.g., 05:23:46)
centered, immediately below the clock.
- Draw a 1 pixel thick square around the clock.
- The background of the window should be white.
- Name your main class file AnalogClock.java. Your code should compile with command-line javac AnalogClock.java
and run with command-line java AnalogClock.
- Follow good coding standards (well structured, indented, and documented code) and
Java naming conventions.
The only widget classes that you are allowed to use are JComponent and JFrame. You must build this assignment from scratch using the Graphics/Graphics2D objects.
Due date
This program is due on or before 2/14. This means it must be received by 11:59pm EDT on 2/14 to not be considered late.
Submitting
Submit your program by creating a zip file with your last name as the file name containing all the source code files
related to your project, and email it to lqiu@oswego.edu with "CS520 Project 1 - your name" as the subject.
When I extract your zip file, your file should create a directory with your last name and all the code should be in that directory.
Do not send your source code directly as attachment to your email because some email program may add line-ending characters to your code which makes it fail to compile on my machine.
Grading rubrics