The GridBagLayout class is a flexible layout manager that aligns components vertically and horizontally, without requiring that the components be of the same size. Each GridBagLayout object maintains a dynamic rectangular grid of cells, with each component occupying one or more cells, called its display area . Each component managed by a grid bag layout is associated with an instance of GridBagConstraints that specifies how the component is laid out within its display area. To use a grid bag layout effectively, you must customize one or more of the GridBagConstraints objects that are associated with its components. The default value is 1.
Possible values are GridBagConstraints.
Valid values are GridBagConstraints. EAST , GridBagConstraints. WEST , and GridBagConstraints. The smallest grid that can be laid out by the grid bag layout. Adds the specified component with the specified name to the layout.