GridBagLayout

GridBagLayout  gridBagLayout icon  (not to be confused with GridLayout) is a powerful layout manager that lets you set almost any layout you want using a complex set of component properties called "constraints."

GridBagLayout provides precise control over all aspects of the layout, even when the container is resized. It is particularly useful for multiplatform Java applications as GridBagLayout enables you to create a freeform layout that maintains a consistent appearance across platforms.

GridBagLayout places components in a grid of rows and columns. Components can span multiple rows or columns, or both. Cells in the grid are not all the same size.

To create a GridBagLayout, use one of these methods: