The various panels in a container are laid out separately in terms of their subcomponents
|
The arrangement is controlled by general strategies which are embodied in 5 LayoutMangers
|
To create a layout, such as FlowLayout, in your panel:
-
setLayout(new FlowLayout());
-
This particular Layout is the default and flows in the components in the order that the add method is called.
|
Other Layout Managers:
-
GridLayout - a regular rectangular grid (table)
-
BorderLayout - 5 areas as in diagram
-
GridBagLayout - general arrangement of space
-
CardLayout - card panels replace each other in the same space.
|