Illustration of GridLayout


Here are several versions of the same applet displayed in different sized areas. Note how the GridLayout makes every Component the same size.



Here the width is 250 and the height is 100

Here the width is 150 and the height is 250


Here is the code for the applet

import java.awt.*;

public class Grid extends java.applet.Applet
{
    public void init()
    {
        setLayout(new GridLayout(3,2));
        add(new Button("One"));
        add(new Button("Two"));
        add(new Button("A Longer Label"));
        add(new Button("Three"));
        add(new Button("Four"));
        add(new Button("Five"));
    }

}