context | - zio Dialog - | author |
What students want these days is a GUI or even a multimedia approach.
In order to give them part of what they want and to emphasize
object-oriented programming at the same time, I have placed two
classes DialogWindow
and DisplayWindow
in the zio package.
Here is a sequence of nine examples of Java source code I intend to use to introduce Java using the zio package and emphasizing objects early on. Each example consists of some source code. Many of them contain exercises in comments. The sequence is fast paced. You may have to introduce extra examples for your own class. One way to do that is to show cut down versions of some of these examples first.
InOut.readImage
and displaying them
with DisplayWindow
.
DialogWindow
.
if
statement. Uses a DialogWindow
to control the creation
and recreation of a DisplayWindow
.
else
, &&
, and ||
.
By the end of this sequence of examples, it is possible to have serious
programing exercises that make use of branching, Strings, inheritance
(limited to DialogWindow
), and method building.
From here I think you could take almost any text and build meaningful examples out out of its material, regardless of the order that material is presented in. I intend to continue with similar examples through Strings, single-dimensional arrays, primitive types, loops, recursion, scope, lifetime, reference semantics, interfaces, and higher-dimensional arrays in approximately that order.
Source code for all these examples, some related data files, and a jar file containing the zio package are bundled together in one zip file. You will need version 1.4 or later of the development system.
context | Jul 12, 2005 | author |