If a Container's default layout manager doesn't suit your needs, you can easily replace it with another one. This lesson gives you some general rules for using layout managers, gives you an overview of the layout managers the AWT provides, and then tells you how to use each of the AWT layout managers. In these pages are applets illustrating layout management. Each applet brings up a window that you can resize to see how resizing affects the layout. How to Use BorderLayout BorderLayout is the default layout manager for all Windows, such as Frames and Dialogs.
All extra space is placed in the center area.
Here's an applet that puts one button in each area. Here's an applet that uses a Choice and CardLayout in this way. How to Use FlowLayout FlowLayout is the default layout manager for all Panels. It simply lays out components from left to right, starting new rows if necessary. Both Panels in the CardLayout figure above use FlowLayouts.