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.

/** A bunch of buttons in a Panel that uses the
 *  default version of FlowLayout.
 *  Java 1.1 only.
 * @see ModifiedFlow
 */

public class NormalFlow extends CloseableFrame {
  public static void main(String[] args) {
    new NormalFlow("Default FlowLayout Configuration",
                   475, 300, 2);
  }

  public NormalFlow(String title,
                    int width, int height,
                    int numPanels) {
    super(title);
    setLayout(new GridLayout(1, numPanels));
    Panel p;
    for(int i=0; i<numPanels; i++) {
      p = new Panel();
      addButtons(p, i, 20);
      add(p);
    }
    setSize(width, height);
    setVisible(true);
  }

   public void addButtons(Panel p,
                         int prefix, int numButtons) {
    for(int i=0; i<numButtons; i++)
      p.add(new Button("Button " + prefix + "-" + i));
  }
}

  

