John Tabbone

Subscribe to John Tabbone: eMailAlertsEmail Alerts
Get John Tabbone: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Top Stories by John Tabbone

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 helper class called GridBagConstraints to place Components on the screen. Basically, a developer will set values in the GridBagConstraints object that specify things such as: Where the component will appear on the screen in relation to the other Components How tall and wide the component is How t... (more)

Polymorphism

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)

Layout Managers

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)

Welcome to OO part 1

"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)

Components, Containers and Events

This article focuses on the building blocks of Java's Graphical User Interface (GUI) building package, which is called java.awt, or just the AWT for short. AWT stands for Abstract Windowing Toolkit. It provides a platform-independent set of tools used by the Java developer to create buttons, windows, checkboxes and other common GUI elements (widgets). The base class for all of Java's widgets is called Component. In addition to providing a wide variety of widgets, the AWT also provides a mechanism to execute code when something happens to the widget. When the user presses your b... (more)