O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The GridBagLayout Layout Manager

Like GridLayout, GridBagLayout positions components in a grid. Unlike GridLayout, in which you explicitly specify the number of rows and columns in the grid, GridBagLayout determines the number of rows and columns from constraints placed upon the components it lays out. Also, unlike GridLayout, GridBagLayout allows components to span more than one grid cell— components may also overlap, as we shall soon discover.

GridBagLayout is capable of handling nearly any layout situation; however, it is one of the most complex and difficult classes in the AWT to use. Developers are often put off by its complexity, but it's an extremely useful layout manager. For that reason, we will apply a three-pronged approach to covering ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required