The images in this tutorial were captured on the Windows platform. This does not, however, affect the validity of the tutorial for other platforms, as the basic functionality of JBuilder and GridBagLayout is the same on all platforms.
The GridBagLayout Tutorial contains animations that demonstrate the behavior of GridBagLayout. These animations can only be viewed online in a JavaScript enabled browser, such as Netscape, or Internet Explorer. Each place a projector icon appears indicates an animation sequence you can view in the online version.
A browser version of the JBuilder documentation is available in the JBuilder /doc
directory. For directions on viewing the documentation in a browser, see "How to get Help" in Getting Started.
XYLayout
for prototyping the UI. If you use JBuilder Foundation edition, substitute null
layout wherever XYLayout
is mentioned.
The GridBagLayout Tutorial is divided into three sections:
Part 1 of the tutorial explains conceptually what the GridBagLayout manager and the GridBagConstraints objects are. It gives you a detailed description of each constraint, and explains how to set the constraint in the JBuilder UI designer. This part also explains why GridBagLayout can be so complicated, and shows you how you can simplify GridBagLayout design by using the UI designer.
Part 2 walks you through the steps of creating a typical dialog box using GridBagLayout. It demonstrates how to plan the UI before you start, and gives you examples of the differences in behavior of the container with different layout choices.
Part 3 is a collection of various tips and techniques for working with GridBagLayout in JBuilder. In this section, each constraint's behavior is examined separately, with examples that show you what to expect when modifying it in the UI designer. A sample is included of the code generated by JBuilder as a result of creating the UI example in Part 2. This part also explains is how to change existing GridBagLayout code to be visually designable in JBuilder.
Part 3 also includes:
Constraints
An overview of the GridBagConstraints and their values.
Example weight-constraints
Illustrated examples of weight constraints applied in different ways.