Illustration of BorderLayout


Here are several versions of the same applet displayed in different sized areas. Note how the BorderLayout changes the sizes of the Components.



Here the width is 350 and the height is 100

Here the width is 200 and the height is 250


Here is the code for the applet

import java.awt.*;

public class Border extends java.applet.Applet
{
    public void init()
    {
        setLayout(new BorderLayout());
        add("North",new Button("One"));
        add("South",new Button("Two"));
        add("East",new Button("A Longer Label"));
        add("West",new Button("Three"));
        add("Center",new Button("Four"));
    }

}