Elements of Graphics: Assignment Zero
Due MIDNIGHT, Tues Sept 9
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 Elements Lab. 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.
See the
Elements Lab Home Page.
- Make a project in either BlueJ or CodeWarrior, load in the two files, compile, and
run it. You should get a window (xwindow) showing with an image in it.
If you do not know how to make a project using CodeWarrior, I suggest using BlueJ -
it's a lot easier.
Look at Mike Scott's instructions on
getting started with BlueJ to see how to make a project, compile and run.
- 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).
If you don't use BlueJ, you can write it with the Microsoft Notepad, or any other way.
Just don't give us a Word document, html file, etc.
- If you use BlueJ, you'll have to ``export'' the files to be able to turn them in.
Use the export function off the File tab.
- Turnin the files ApplicationFrame.java, FirstFrame.java, and README, using
turnin.
Don Fussell