- Teaches object-oriented programming in Java.
- One of the best object-oriented languages (though not
without flaws)
- Much easier and less error-prone than C++
- Supports event-driven programming
- Uses locally written library to make it easy to do
interesting graphics early in course.
- Involves lots of fun programming projects, but teaches
practical material necessary to solve problems in many areas.
Because the lecture time will be filled with
developing examples, I will usually put running versions of
those programs and the code for them in the lecture notes. I
will try to get these on-line within 24 hours of the lecture.
- General form of class definition
- Graphics coordinate systems
- Contructors for graphics classes
- WindowController (mouse-event-handling) methods
Class Examples:
- Design a class to draw "Hello World" at (90,150), and
a 50 by 30 filled rectangle at (100,100). When the mouse is
pressed the program will also drw two nested ovals and a straight
line.
Click on
MakeBox
to show the example.
- Design a class that first draws the words "up" and
"down" on the screen, with the word "up" in red and "down"
in gray. When the mouse is depressed, reverse the colors.
Click on
UpDown
to show the example.