The FlowLayout class places components in a container from left to right. When the space in one row is exhausted, another row is started. The BorderLayout class has five zones as depicted in Figure 7. A single component can be placed in each of these five zones. When the enclosing container is resized, each border zone is resized just enough to hold the component placed within.
Any excess space is given to the center zone.
The first argument is a String object that names the zone in which to place the component. Each container class has a default layout manager. The default layout manager for the Frame class and Dialog class is the BorderLayout manager. The code in Listing 5 uses both layout managers and includes a few more user interface components. The result is displayed in Figure 8. import java.awt.