package graphbrowser;

import java.awt.event.*;
import java.applet.*;
import java.awt.*;


public class LabelDialog extends Dialog implements ActionListener  {


  Label     label1;
  Button    okButton;
  //boolean   value=true;
  Frame source;


  public LabelDialog(Frame parent, String title,String message) {
      super(parent,title,true); // model dialog


      label1=new Label(message);
      okButton=new Button("OK");
      //cancelButton=new Button("Cancel");
      source=parent;

      setLayout(new BorderLayout() );

      Panel p1=new Panel();
      //p1.setLayout(new GridLayout(2,2,0,5) );
      p1.add(label1);

      Panel p2=new Panel();
      p2.setLayout(new FlowLayout(FlowLayout.CENTER));
      p2.add(okButton);
      //p2.add(cancelButton);

      // add event listeners
      okButton.addActionListener(this);
      //cancelButton.addActionListener(this);

      this.setEnabled(true);

      this.add(p1,"North");
      this.add(p2,"South");
      this.pack();
      this.setLocation(source.getLocation().x+5,source.getLocation().y+5);

      //this.show();
  }

  public void actionPerformed(ActionEvent e) {

    if (e.getSource() == okButton) {
       setVisible(false);return;
    }

  }

/*  // callback for external data-fetching use

  public boolean getValue() {
    return value;

  }
*/
}