import java.awt.*;

// This appears in Core Web Programming from
// Prentice Hall Publishers, and may be freely used
// or adapted. 1997 Marty Hall, hall@apl.jhu.edu.

/** This illustrates the effect of specifying 0 for
 *  the number of columns. The number of rows
 *  is read from the command line (default 2), and
 *  the column number is chosen by the system to get
 *  as even a layout as possible.
 */

public class ElevenButtons extends QuittableFrame {
  public static void main(String[] args) {
    int numRows = 2;
    if (args.length > 0)
      numRows = Integer.parseInt(args[0]);
    new ElevenButtons(numRows);
  }

  public ElevenButtons(int numRows) {
    super("11 Buttons using GridLayout("
          + numRows + ", 0).");
    setLayout(new GridLayout(numRows, 0));
    for(int i=0; i<11; i++)
      add(new Button("Button " + i));
    resize(600, 400);
    show();
  }
}

