// File: HelpFrame.java // Classes: HelpFrame // Author: Kedar Patankar package edu.neu.ccs.demeter.tools.apstudio.graphedit; import java.awt.Frame; import java.awt.Button; import java.awt.Event; import java.awt.TextArea; import java.awt.Color; import java.awt.Font; import java.awt.BorderLayout; import java.awt.Panel; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.event.WindowEvent; import java.awt.event.WindowAdapter; public class HelpFrame extends Frame implements ActionListener { private Button _cancel; public HelpFrame(String basefile) { super("User's guide ..."); setLayout(new BorderLayout()); Panel buttonPanel = new Panel(); _cancel=new Button("Close"); _cancel.addActionListener(this); // jdk 1.1 buttonPanel.add("East",_cancel); add("South",buttonPanel); // jdk 1.1 type window event handling addWindowListener(new HFAdapter()); // using inner class for window handling. HtmlPanel hp = new HtmlPanel(basefile); add("Center",hp); } public void setVisible(boolean status) { if(status) _cancel.requestFocus(); super.setVisible(status); } public void actionPerformed(ActionEvent event) { close(); } private void close() { setVisible(false); dispose(); } // inner class VDAdapter class HFAdapter extends WindowAdapter { public void windowClosing(WindowEvent event) { close(); } } } /* end class HelpFrame */