"Hi, everybody!" the large programmer/teacher announces as he bounces into a
class full of aspiring Java programmers. "Welcome to Java."
My name is John Tabbone. I teach Java at NYU's Information Technologies
Institute. ITI is a professional program and the students who enroll in my
course typically have a diverse skill set. The usual makeup of a class
includes C++ programmers, VB and PB developers, Cobol/Mainframe people and a
few people whose only programming experience is seeing the new Java
commercials. We run the gamut. But beneath the variety of technical
backgrounds is the common desire to learn about Java.
People take my class for one of two reasons: They are anticipating a life
change or they need to learn something specific for a project they are
working on. Regardless, I have found that to learn Java, there is a need to
understand principles. Even the seas... (more)
"Hi Everybody," John Tabbone announces as he walks into a class full of
aspiring Java students. "Today, we are starting a multi-part class on
object-orientation, OO for short." The students lean forward as if they were
engaged in a campfire story. "I have heard the term before; John said it is
central to Java programming," thinks one typical student. "I read somewhere
that OO will probably be the dominant programming style until the end of the
millennium," thinks the first student's typical classmate.
Object Orientation is a way of thinking. It is a tool used to model a system
a... (more)
My last column covered Components, Containers and Events. The material
discussed Java's different kinds of Components, the class structure, how
Components generate events and how those events can be handled. We discussed
the differences between Components and Containers. To recap, Component is the
base class for all user interface widgets. A Container is a descendant of
Component whose sole purpose is to hold other Components. For example, if you
were to create a user interface and you wanted to add several buttons and
text areas, you would create instances of the appropriate cla... (more)
My last column focused on several of Java's LayoutManagers, which are
constructs used by developers to position Components within Containers using
logic instead of pixel coordinates. We discussed all of Java's LayoutManagers
except GridBagLayout, which is the focus of this article.
Of all of Java's LayoutManagers, GridBagLayout offers the developer the most
precision in positioning Components. This ability comes at a great expense,
as GridBagLayout is the most complicated (and probably the most poorly
documented) LayoutManager in the AWT. GridBagLayout works integrally with a
hel... (more)
My last column introduced you to object orientation and discussed how some of
the principles are expressed in Java. In particular, we were working with a
chess example. Also, there was an assignment. You were to think about the
classes: mammal, human and canine, and how one might use Java notation and
inheritance to describe this small taxonomy system. This column will continue
with OO by reviewing the assignment and explain a powerful feature called
polymorphism.
Remember that the principal thrust of OO is to model a system. A system is
composed of objects and the relationships... (more)