Fall 2002
Homework #5
due Thu Nov 21, by 6AM -- electronic submission

hardcopy due in class: 2.45PM

The goals of this assignment are to:

  1. implement an applet
  2. build a graphical user interface
  3. learn how to use Java graphics

You need to modify the GUI example from class as follows:

  1. include at least 4 of the following GUI components: Button, Checkbox, Choice, Label, List, TextArea, TextField
  2. additionally, you must include a Canvas
  3. at least 2 of the components must be attached to some type of behavior in the applet and you must handle events using a listener interface (i.e., clicking on a button must do something visible in the applet)
  4. use any layout manager except FlowLayout (BorderLayout is fine)
  5. include at least 5 of the following AWT drawing primitives in the Canvas: drawString, drawLine, drawRect, drawOval, drawArc, fillRect, fillOval, fillArc
  6. be CREATIVE!!!

The working applets will be posted in a gallery on the class web page.

Your assignment will consist of:

You can use the examples from class as the basis for your assignment, but you MUST change the example(s) significantly in terms of the components used and the drawing done.

source code.
Your source code (i.e., your .java file) but be neat and clearly commented. You must have a header comment and you should comment the end of each block (i.e., each }). You need to comment each method that you write within each class.

Follow the submission instructions carefully!!! If you don't, human intervention will be required to fix your mistakes, and you will lose 1 point.

  1. Name your homework files properly.
    You will submit (at least) 2 files:
    1. hw5<yourCUNIXusername>.java
      For example, mine is called hw5eis2003.java.
    2. hw5<yourCUNIXusername>.html
      For example, mine is called hw5eis2003.html.

  2. Submit your files electronically.
    You need to turn in ALL the Java source code, Follow instructions on the assignments page.

  3. Turn in a harcopy of your program during THE FIRST 5 MINUTES OF class.
    Print out the homework template cover page (http://www.columbia.edu/~cs1007/hw-template.html) and fill it out.
    Staple the cover page to a hardcopy (print-out) of your program. You need to turn in ALL the Java source code and the HTML file. Make sure your name is on all the papers you hand in!
    Bring the cover page and hardcopy to class on the day the assignment is due and deposit it in the homework box at the front of the classroom within the first 5 minutes of the class.

This assignment is worth 10 points (out of 100 for the semester). Distribution of points is: