CS 680
Spring, 2005
Ethan Bolker and Michael Weiss
hw1 - GUI programming
DRAFT
Due:
This is a warmup exercise to introduce you to GUI programming - how to
construct a display (GUI syntax - the composite design pattern) and
how to program window actions (GUI semantics - the observer design
pattern).
The relevant material is covered in Jia (Sections 2.2, 2.3.1, 8.3, 9.1
and 9.2).
Here's a partial solution.
-
Apply for a CS680 account on the Department's unix system.
-
Get the textbooks for the course. (You will need Jia right away.)
-
You will find the source code for
version 1 of the scribble application in Chapter 9 of Jia in
http://se.cs.depaul.edu/Java/chap09.html
Get it, compile it, run it, understand it.
-
Modify the scribble application so that it puts up two canvases to
scribble on, side by side. Each canvas should have a button beneath it
labelled "clear". Clicking the button should clear that canvas.
Here's a picture of what you might
write. (You don't have to get the colors and sizes to match.)
Your source code
- must be well designed - if you simply add some lines of code to
make the application work, look at what you've done and think "that's
pretty ugly - not how I would have done it if I'd started from
scratch" - them reorganize your code. Don't be afraid to design new
classes.
- must honor formatting conventions - either Jia's, or your own
(note that I changed some of Jia's code when I retyped it).
- should have no duplicated code (don't program by cutting a block
of java, pasting it somewhere else and just changing a token or two).
- should indicate clearly where you have modified Jia's code and
where it is unchanged.
- Write ta memo discussing your design and coding process. Where did you
encounter problems? How did you solve them? What did you learn?
We will collect your work electronically from the cs680 directory the
Department's unix system created for you when it approved your account
for this course. Do not modify the permissions for that directory.
We will look for the following files in a hw1 subdirectory for the
following files
- memo.txt
- scribble.jar
- *.java
Back to the CS680 home page.