// CSC 442F - Software Engineering
// Software:    Calendar Client
// Component:   HelpBox class
// Description: Used to display a help window

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

public class HelpBox extends Dialog implements ActionListener
{
   private Button ok;
   private TextArea helptext;

   public HelpBox (Frame parent, String title, String messageString,
                   boolean freeze, int rows, int columns)
   { 
      super (parent, title, freeze);

      helptext = new TextArea (messageString, rows, columns);
      helptext.setEditable(false);
      add (helptext, BorderLayout.NORTH);

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

      addWindowListener (new CloseWindow());
   } 

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