CS 280 Spring 2009 Assignment 1 –Simple GUI 50 “Assignment” points
Assigned: 01/22/2009
Due: 01/29/2009 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 to teach a little bit of “Philly” sports info. Imagine that they will have buttons for “Football”, “Baseball”, and “Hockey” and “Basketball”, plus an “Quit” and a “Reset” button. The sport buttons should cause the corresponding Philadelphia team name to be displayed on the screen, with the corresponding color as the foreground color for the word (see background knowledge below, if necessary). The reset button should put the word “TEAM” showing and a black foreground. The Quit button should exit the application (Also, put your name on the GUI form as a jlabel).
Background Knowledge:
User Interface:
· You’re just a beginning at setting up GUIs in NetBeans. Don’t worry too much about making the interface nice. See my simple sample interface below. You do not have to make your interface exactly like mine (or even that close). But have the program DO the right things.
Miscellaneous Details:
· The System library includes an exit method).
· Comments can be written either starting with // or surrounded by /* and */
Good Programming Practices:
· MAKE SURE YOUR PROGRAM WORKS! (i.e. gets correct results). It must provide all of the requested capabilities AND provide them in the expected way.
· Put YOUR NAME, e-mail address, and purpose of the program in comments at the beginning of the program (Netbeans should also automatically put in the date – which is also a very good practice). The purpose should be what the program is supposed to do, not the learning goals.
· Name meaningfully all jbuttons, jtxtfields, etc that will be referred to in code.
· Indent to show any structure of the program (The IDE usually does this well if you don’t go back and change things – probably not much to worry about on this basic of a program)
· You MUST include some comments that explain your program in order to get full credit; for this simple program put one comment for each button
Red Tape to Aid Grading:
· Please set the name of the project to something other than the default name (JavaApplication1, …).
· Add your name in a jlabel on the GUI form and/or in the title bar.
Hand in:
Do your own assignments !!!! Work that is copied or done with somebody (when not assigned to a group) will be punished. If programs are copied, both students will receive a zero for the assignment. If significant sections of programs are copied, points will be taken off. Changing small aspects of a copied program does not make it not a copy. Asking another for help on a step or two in a many-step assignment is acceptable; looking at another person’s program is temptation for cheating; handing in a near duplicate program is cheating
Sample Interface:
On Startup or After Selecting Reset:

After Baseball clicked:
