import java.applet.Applet;
import java.awt.*;

// A variation of a class that appears in Core Web
// Programming from Prentice Hall. May be freely used
// or adapted.
// 1998 Marty Hall, http://www.apl.jhu.edu/~hall/java/

/** 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 = getSize().width*4/10,
        width2 = getSize().width - width1,
        height = getSize().height;
    Panel buttonPanel = new Panel();
    buttonPanel.setBounds(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.setBounds(width1+1, 0,
                             width2, height);
    everythingElse.add(new Label("Everything Else"));
    add(everythingElse);
  }
}

