import java.applet.Applet;
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 variation of ButtonCol that adjusts the width
 *  taken by the column of buttons. The top-level
 *  panels are positioned by hand. Since applets can't
 *  be resized in most browsers, setting the size
 *  once when the applet is created is sufficient.
 * @see ButtonCol
 */

public class ButtonCol2 extends Applet {
  public void init() {
    setLayout(null);
    int width1 = size().width*4/10,
        width2 = size().width - width1,
        height = size().height;
    Panel buttonPanel = new Panel();
    buttonPanel.reshape(0, 0, width1, height);
    buttonPanel.setLayout(new GridLayout(6, 1));
    buttonPanel.add(new Label("Buttons", Label.CENTER));
    buttonPanel.add(new Button("Button One"));
    buttonPanel.add(new Button("Button Two"));
    buttonPanel.add(new Button("Button Three"));
    buttonPanel.add(new Button("Button Four"));
    buttonPanel.add(new Button("Button Five"));
    add(buttonPanel);
    Panel everythingElse = new Panel();
    everythingElse.reshape(width1+1, 0, width2, height);
    everythingElse.add(new Label("Everything Else"));
    add(everythingElse);
  }
} 

