
CISC 370 Lecture Notes for Class No. 10, March 9, 2000
| Course Home | Prev Lect | Next Lect | Example Progs | Exercise Solns | CoreJava Progs Documentation |
Gen'l Docs | Java 2 APIs | Java Glossary | Term Proj Info |
1. Create a class PedLight analogous to TrafficLight that extends JPanel. It should have two states: (a) one with a green background and the word "Walk" in large letters centered on the background, and (b) a second with a red back ground with the phrase "Don't Walk" in the same large font centered on it. Then create a PedFrame class, analogous to TrafficFrame, that puts two instances of PedLight, one in each state, on a frame with one at the top, NORTH, and the other at the bottom, SOUTH. Do not forget to include the methods getMinimumSize() and getPreferredSize() in PedLight.
To prepare programming assignments for submission, do the following for each exercise.
script // Produces a file named typescript whoami date pwd cat *.java javac *.java // mainFile should be the name of the file containing java mainFile // your main() method exit // to exit script
Now print the typescript file for submittal at the beginning of lecture.
On strauss, you can use xv as demoed in lecture to grab and print a copy of the graphics output from your Java programs that should be handed-in with your assignment.
Particularly notice the following features of this code.
Back to the
CISC 370 homepage.
This page has been accessed
times since 10 Mar 2000.
Corrections, suggestions and comments to Bob Caviness
Copyright
2000 B. F. Caviness