last updated: Wed Apr 4
CS1007
Spring 2002
Homework #5
due TUE Apr 16, by 6AM -- electronic submission
hardcopy due IN CLASS: 11.05AM cs1007-002; 2.45PM cs1007-001
goal.
The goals of this assignment are to:
- implement an applet
- build a graphical user interface
- learn how to use Java graphics
specifications.
You need to modify the GUI example from class as follows:
- include at least 4 of the following GUI components:
Button, Checkbox, Choice, Label, List, TextArea, TextField
- additionally, you must include a Canvas
- at least 3 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)
- use any layout manager except FlowLayout (BorderLayout is fine)
- include at least 5 of the following AWT drawing primitives in the
Canvas: drawString, drawLine, drawRect, drawOval, drawArc, fillRect,
fillOval, fillArc
- be CREATIVE!!!
The working applets will be posted in a gallery on the class web page.
Your assignment will consist of:
- a class that extends an Applet,
in a file named hw5<yourCUNIXusername>.java
- an HTML file that invokes the Applet,
in a file named hw5<yourCUNIXusername>.html
- You may include additional class files, if necessary, named
whatever you want --- but the Applet has to be in the
hw5<yourCUNIXusername>.java file.
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. Check the syllabus web page for
code from the Apr 2 and Apr 4 lectures.
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.
submission.
Follow the submission instructions carefully!!!
If you don't, human intervention will be required to fix your
mistakes, and you will lose 0.5 points.
- Name your homework files properly.
You will submit (at least) 2 files:
- hw5<yourCUNIXusername>.java
For example, mine is called hw5eis2003.java.
- hw5<yourCUNIXusername>.html
For example, mine is called hw5eis2003.html.
- Submit your files electronically.
You need to turn in ALL the Java source code,
Follow instructions on the assignments page.
- 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:
cs1007-002: 11.05am
cs1007-001: 2.45pm
points.
This assignment is worth 7 points (out of 100 for the semester).
Distribution of points is:
- 0.5 points for following submission instructions (i.e., no human
intervention required)
- 0.5 points for commenting source code as described above and
using a clear programming style (i.e., indenting code consistently,
using meaningful variable names, etc.)
- 0.5 points for submitting a working applet and accompanying HTML file
- 1.0 points for including the 5 GUI components (Canvas plus 4 others,
0.2 points each)
- 1.0 points for including the 5 drawing primitives (0.2 points each)
- 1.5 points for implementing 3 behaviors (0.5 points each)
- 1.0 points for using a layout manager
- 1.0 points for creativity