The result of this is that all components have the same size. The GridBagLayout manager is more powerful but also much more complicated to use than the simpler GridLayout manager. As in the GridLayout manager, the container is divided into a grid of rows and columns. Setting these up is a topic for a future article. The Panel class is a general-purpose type of container that can be used to hold other components.
Panels are very useful for improving the layout of a container.
Recall that the Applet class extends Panel . This permits an applet to run in a browser or appletviewer. From the Container class the Panel class inherits the hooks for layout management, which determines the position and size of each of its components and offers the ability to manage groups of components. Interestingly, the default layout manager for a Panel is the FlowLayout layout manager. It is possible to add components in the absence of a layout manager.