Elements of Graphics: Assignment Zero
Due MIDNIGHT, Monday January 29
The purpose of this assignment is to get us all to work through the mechanics
of bringing up a window and drawing something in Java using either
CodeWarrior or BlueJ, and handing in an
assignment in the Elements Lab.
If you intend to work on a home computer as well as in the lab, you should
use this time to install the SDK
(Sun's Java development tools) and
CodeWarrior or BlueJ on your home machine, if necessary.
The assignment is to draw something using the shapes and colors built into the
Graphics2 class and the java.awt.geom package.
Here are two files. ApplicationFrame.java
is the class which defines a window, shown on page 8 in Knudsen's Java 2D
Graphics book. I've added some comments.
FirstFrame.java extends ApplicationFrame to
actually put the window up on the screen and draw something in it.
The assignment is:
- Log onto one of the machines in the one of the labs. Even if you do the
assignment on a home computer you need a working account to turn it in, so
make sure you have one. Enrolled students should automatically get accounts,
but you need to find out your password.
You can apply for an account online
here.
See the
Elements Lab Home Page for more information.
- Make a project in you IDE, load in the two
files, compile, and run it. You should get a window (xwindow) showing
with an image in it.
- Open a plain text file called README.TXT, and write in it:
- ``Assignment Zero README''
- Your name
- Your ID number
BlueJ automatically gives you README.TXT when you create a project (it's the icon
that looks like a sheet of paper).
Use a .txt file, don't give us a Word document, html file, etc.
- Turnin the files ApplicationFrame.java, FirstFrame.java, and README, using
turnin.
Don Fussell