Using nested panels and layouts

Most UI designs in Java use more than one type of layout to get the desired results by nesting multiple panels with different layouts in the main container. You can also nest panels within other panels to gain more control over the placement of components. By creating a composite design, and by using the appropriate layout manager for each panel, you can group and arrange components in a way that is both functional and portable.

For example, the following sketch demonstrates the use of nested panels with different layouts. The solid gray objects are the buttons and other visible components in the UI which are nested in various levels of panels.