import java.awt.*;

// This appears in Core Web Programming from
// Prentice Hall Publishers, and may be freely used
// or adapted. 1997 Marty Hall, hall@apl.jhu.edu.

/** A Frame that you can actually quit. Used as
 *  the starting point for most Java 1.0 graphical
 *  applications. CloseableFrame is the Java 1.1 version.
 * @see CloseableFrame
 */

public class QuittableFrame extends Frame {
  public QuittableFrame(String title) {
    super(title);
  }

  /** Catch window destroy events. Pass all other
   *  events to the original handler.
   */
  
  public boolean handleEvent(Event event) {
    if (event.id == Event.WINDOW_DESTROY) 
      System.exit(0);
    return(super.handleEvent(event));
  }
}
