defaultL = new Label("Default:", Label.RIGHT); defaultC = new Choice(); for(int i = 0; i < hexList.length; i++) { defaultC.add(hexList[i]); } if(hexSelected != -1) { defaultC.select(hexSelected); }  okayB = new Button("Okay"); okayB.setActionCommand("done"); okayB.addActionListener(this); okayB.setSize(80, 24);
butOkay = new Button("Okay"); butOkay.setActionCommand("done"); butOkay.addActionListener(this); butOkay.setSize(80, 24);
    public BoardNewDialog(Frame frame, String[] hexList, int hexSelected) {        super(frame, "Set Dimensions", true);                xvalue = 0;        yvalue = 0;                xL = new Label("Width:", Label.RIGHT);        yL = new Label("Height:", Label.RIGHT);                xT = new TextField("16", 2);        yT = new TextField("17", 2);                defaultL = new Label("Default:", Label.RIGHT);        defaultC = new Choice();        for(int i = 0; i < hexList.length; i++) {            defaultC.add(hexList[i]);        }        if(hexSelected != -1) {            defaultC.select(hexSelected);        }                okayB = new Button("Okay");        okayB.setActionCommand("done");        okayB.addActionListener(this);        okayB.setSize(80, 24);        cancelB = new Button("Cancel");        cancelB.setActionCommand("cancel");        cancelB.addActionListener(this);        cancelB.setSize(80, 24);        GridBagLayout gridbag = new GridBagLayout();        GridBagConstraints c = new GridBagConstraints();        setLayout(gridbag);        c.fill = GridBagConstraints.NONE;        c.weightx = 0.0;    c.weighty = 0.0;        c.insets = new Insets(5, 5, 1, 1);                gridbag.setConstraints(xL, c);        add(xL);                c.gridwidth = GridBagConstraints.REMAINDER;        gridbag.setConstraints(xT, c);        add(xT);                c.gridwidth = GridBagConstraints.RELATIVE;        gridbag.setConstraints(yL, c);        add(yL);                c.gridwidth = GridBagConstraints.REMAINDER;        gridbag.setConstraints(yT, c);        add(yT);                c.gridwidth = GridBagConstraints.RELATIVE;        gridbag.setConstraints(defaultL, c);        add(defaultL);                c.gridwidth = GridBagConstraints.REMAINDER;        gridbag.setConstraints(defaultC, c);        add(defaultC);                c.ipadx = 20;    c.ipady = 5;        c.gridwidth = GridBagConstraints.RELATIVE;        gridbag.setConstraints(okayB, c);        add(okayB);                c.gridwidth = GridBagConstraints.REMAINDER;        gridbag.setConstraints(cancelB, c);        add(cancelB);                pack();        setResizable(false);        setLocation(frame.getLocation().x + frame.getSize().width/2 - getSize().width/2,                    frame.getLocation().y + frame.getSize().height/2 - getSize().height/2);    }