BorderLayout Class:
An AWT BorderLayout class places controls so which they fill their Container object. A control is placed according to a geographic position which you specify. A Control could be placed on the south, north, east, and west edges of the Container. You could also place a control in the center of the Container. A centered control is then expanded to fill the remaining space. Figure displays the border applet along with five controls. A border applet creates a simple BorderLayout:
import java.awt.*;
public class border extends java.applet.Applet {
public void init() {
setLayout( new BorderLayout() ) ;
add( "North", new Button( "NORTH" ) ) ;
add( "South", new Button( "SOUTH" ) ) ;
add( "East", new Button( "EAST" ) ) ;
add( "West", new Button( "WEST" ) ) ;
add( "Center", new Button( "CENTER" ) ) ;
}
}
Whenever you create a BorderLayout, you could specify vertical and horizontal gap values as you could within the setLayout() method (defined in the flow applet).