Using the GridBagLayout Manager
Finally, we saved the most important and the most complicated layout manager for last. GridBagLayout divides the frame into rows and columns as it did with GridLayout. Both GridLayout and GridBagLayout share the same definition of a cell—the intersection of a row and a column. Each component, however, is not restricted to be just the size of one cell, but can span multiple cells (see Figure 12.7). The area in which a component can span multiple cells is called its display area. This difference makes GridBagLayout the most flexible and the most portable of all the layout managers. Even though GridBagLayout is complex, it behaves best if you use a smaller number of nested panels.
Figure 12.7. Using GridBagLayout ...
Get Borland® JBuilder™ Developer’s Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.