CS 280 Spring 2008                           Assignment 1 –Simple GUI                                              50 “Assignment” points

 

Assigned: 01/17/2006

Due: 01/23/2008 at the start of class

 

Pre-Lab (Do Before Lab):  None – in fact, I need to lecture at the beginning of lab to have covered enough.

 

Main Assignment:

Imagine that you are writing a very basic program for a small child.  Imagine that they will have buttons for “Red”, “Yellow”, and “Green”, plus an “Exit” and a “Clear” button. The color buttons should cause the corresponding word to be displayed on the screen, with the corresponding color as the foreground color for the word (There is a library java.awt.Color which includes constants for RGB colors for common colors such as BLACK). The clear button should leave the word “Color” showing and a black foreground. The Exit button should exit the application (The System library includes an exit method). 

·         Also, put your name on the GUI form as a jlabel.

·         You’re just a beginning at setting up GUIs. Don’t worry too much about making the interface nice. See my simple sample interface below

Hand in:

 

Miscellaneous:

·         MAKE SURE YOUR PROGRAM WORKS!  

·         Put YOUR NAME, e-mail address, and purpose of the program  in comments at the beginning of the program (date should go in automatically). The purpose should be what the program is supposed to do, not the learning goals.

·         Indent to show any structure of the program (The IDE usually does this well)

·         Name all jlabels, jbuttons, etc meaningfully.

·         If you missed the beginning of the lab during which I showed similar things in the IDE, you may need to seek help from me, classmates or the (free) tutors.