GridBagLayout
GridBagLayout is a flexible layout manager in Java that is used with AWT and Swing. It arranges components in a grid of rows and columns and allows components to span multiple cells. The layout's behavior is controlled by GridBagConstraints, which encode the position, size, and resizing behavior of each component.
Key concepts include gridx and gridy, which specify the component's cell coordinates, and gridwidth and gridheight,
GridBagLayout computes the sizes of columns and rows from the components' preferred and minimum sizes, adjusted
This layout is particularly useful for complex, responsive user interfaces where nesting multiple panels would be