This lesson gives you some general rules for using layout managers, gives you an overview of the layout managers we provide, and then tells you how to use each of our 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. This section answers these and other questions that apply whenever you use a layout manager. 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, centering them within their row and, if necessary, starting new rows. Both Panels in the CardLayout figure above use FlowLayouts.