// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   ButtonDialog.java

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class ButtonDialog extends Dialog
    implements ActionListener
{

    public ButtonDialog(Frame frame, String s, String as[])
    {
        super(frame, true);
        returnValue = "";
        Button abutton[] = new Button[as.length];
        Panel panel = new Panel(new GridBagLayout());
        Label label = new Label(s);
        for(int i = 0; i < as.length; i++)
        {
            abutton[i] = new Button(as[i]);
            abutton[i].addActionListener(this);
            panel.add(abutton[i]);
        }

        add(label, "North");
        add(panel, "Center");
        pack();
        Dimension dimension = getSize();
        Dimension dimension1 = frame.getSize();
        Point point = frame.getLocation();
        point.translate((dimension1.width - dimension.width) / 2, (dimension1.height - dimension.height) / 2);
        setLocation(point.x, point.y);
        setResizable(false);
        show();
    }

    public String answer()
    {
        return returnValue;
    }

    public void actionPerformed(ActionEvent actionevent)
    {
        returnValue = actionevent.getActionCommand();
        dispose();
    }

    String returnValue;
}

