001//****************************************************************************** 002// BinaryClockAppFrame.java: 003// 004//****************************************************************************** 005package ca.bc.webarts.tools; 006 007import java.awt.*; 008 009//============================================================================== 010// STANDALONE APPLICATION SUPPORT 011// This frame class acts as a top-level window in which the applet appears 012// when it's run as a standalone application. 013//============================================================================== 014class BinaryClockAppFrame extends Frame 015{ 016 // BinclockAppFrame constructor 017 //-------------------------------------------------------------------------- 018 public BinaryClockAppFrame(String str) 019 { 020 // TODO: Add additional construction code here 021 super (str); 022 this.enableEvents(AWTEvent.WINDOW_EVENT_MASK); 023 } 024 025 // The processEvent() method receives all events generated within the frame 026 // window. You can use this method to respond to window events. To respond 027 // to events generated by menus, buttons, etc. or other controls in the 028 // frame window but not managed by the applet, override the window's 029 // action() method. 030 //-------------------------------------------------------------------------- 031 public void processEvent(AWTEvent evt) 032 { 033 switch (evt.getID()) 034 { 035 // Application shutdown (e.g. user chooses Close from the system menu). 036 //------------------------------------------------------------------ 037 case Event.WINDOW_DESTROY: 038 // TODO: Place additional clean up code here 039 dispose(); 040 System.exit(0); 041 return; 042 043 default: 044 super.processEvent(evt); 045 } 046 } 047}