|CIT 591 Seventh Java Assignment: GUI
for Adventure Game
David Matuszek, Fall 2002
Purposes of the assignment:
- To get you started writing Graphical User Interfaces (GUIs)
- To give you practice using the Java APIs
The basic idea:
The GUI that I've provided is a very simple one; you type in commands at the
bottom, and the transcript (commands and results) appears in the rest of the
window. It looks something like this:
Your task is to add Components (such as Lists and Buttons) and Listeners to
this GUI, so that you can do most operations just by pointing and clicking,
rather than typing in commands. (But keep the ability to type in commands.)
My GUI for doing this looks like:
In this GUI:
- The top line shows your location.
- You can move by clicking on a direction (under Exits:), then on the
- You can pick up a thing by clicking on the thing's name (under You
see:), then on the Take button.
- You can use a thing by clicking on its name (under You are
holding:), then on the Use button.
- You can drop a thing by clicking on its name (under You are
holding:), then on the Drop button.
- You can save a copy of the transcript to a file by clicking on the
- You can still type in commands if you prefer.
Your GUI does not need to look exactly like this!
- Do not use Forté, JBuilder, or any of the other IDEs that
create a GUI for you. I want you to implement this GUI "by hand,"
so you know exactly what is involved.
- Use AWT, not Swing.
- You should display your name somewhere on the GUI.
- Your GUI should be reasonably neat, but it does not need to be perfect.
It's very difficult to get an AWT GUI to look exactly the way you want it
to, so don't work too hard at it.
- Your GUI should provide point-and-click versions of all the commands.
- If there is no need for the command. For example, my GUI shows the
inventory (what you are holding) at all times, so there is no need
- If the command requires text input (for example, saying a magic
- Keep the ability to type in commands.
- Provide both a text command and a Button for saving the transcript
to a text file.
- If you look carefully at the program, you will find that all the hard
work has already been done.
- Add javadoc comments for any new classes, methods, or public variables
that you have added to my basic program.
- You might (or might not) find my
javadoc documentation for
this program useful. You can see it from within BlueJ by choosing Interface
rather than Implementation in any class window.
- You should put an
@author tag in each of your new classes.
It would be appropriate to add a new
@author tag (in addition
to mine) in each of my classes that you modify.
- You will probably find the examples in widgets.html to be helpful; feel
free to borrow code from there.
Wednesday, November 13, before midnight. Please turn in a zip or jar
file via Blackboard.