import java.awt.*;
import java.awt.event.*;

public class MsgBox extends Dialog implements ActionListener
{
   private Button ok;
   private Label msg;

   public MsgBox (Frame parent, String title, String messageString, int width, int height)
   { 
      super (parent, title, true);
      setSize(width, height);
      setResizable (false);

      msg = new Label (messageString, Label.CENTER);
      add (msg, BorderLayout.CENTER);

      ok = new Button ("OK");
      ok.addActionListener (this);
      add (ok, BorderLayout.SOUTH);   

      addWindowListener (new CloseWindow());
   } 

   public void actionPerformed (ActionEvent e)
   {
      if ((e.getSource())==ok) 
         dispose();
   }
}
