CS/CE 2336 – Computer Science II (Advanced Java Programming), Summer 2012

Assignment 1

Due at 11:59pm, Friday June 15th - 100pts

Directions:Implement a class or classes which contain the following:

Inheritance – at least one use of superclasses and subclasses, including keyword superand at least one use of a static variable and a static method

Polymorphism – at least one use of overloading and overriding methods

Encapsulation – at least one use of public, private, default, protected, final

Abstract class with at least one abstract method

At least one interface

GUI – Implement a GUI for this program using swingwhich contains at least one instance of the following components:

  • JFrame (with a title and which exits on close)
  • JButton
  • JLabel
  • JTextField
  • JCheckBox
  • JRadioButton
  • JComboBox
  • JPasswordField (user should be able to enter a password and have it either confirmed or rejected, then display that message along with a timestamp displayed as hours:minutes:seconds AM/PM)
  • Load and display an image
  • Display current month, day, and year

Each reactivecomponent (meaning a component that does something when you do something to it, such as clicking, entering a value, etc.) in your GUI should have at least one listener/event handler and perform some displayable action (i.e. something on the screen changes) either in the JFrame or in a command window

Also in your GUI, draw at least one of each: empty shape, filled shape, a line, and a string (different from your JLabel)

Requirements:Programming assignments should be submitted using your eLearning account. Each programming assignment must contain the following:

1. A text copy of all source code including its documentation (.java)

2. A file showing test cases for your programs input and displayed output (.doc)

3. Copies of all Java executable code (.class) files needed to execute the program.

Grading: Programming assignments will be graded according to the following metrics:

Code Development - 30% (compile w/o error)

Program Execution - 20% (run successfully)

Program Design - 25% (conform to spec)

Documentation - 15% (program, comments) see below

Coding Style - 10% (clear, efficient)

Program documentation standards (example):

/**************************************************************************************** Program: program name

* Function: program function (descriptive, not literal)

* Input: program input (descriptive, not literal)

* Output: program output (descriptive, not literal)

* Notes: any additional information about this program, particularly if it uses code written by other authors,

* in which case it should be properly referenced (i.e., other author name, website, etc.)

***************************************************************************************/

import…

//global variables

int x;//describes global variable x

int y; //describes global variable y

//this class does something really important…

public class makeItCool ( )

{

double z;//describes local variable z

stuff;//this stuff does some really cool stuff

//if this stuff isn’t cool, then make it cool

if (! cool)

{

cool = true;//now everything’s cool

}

else

{

return 0; //already cool

}

}

public class…( )

1