Create Xref-Html Frames Remove All Frames -------------------------------------------------------------------------------- file:D:/new_bde2java/src/bde2java/client/Bde2JavaApplet.java (Tue Dec 17 23:08:37 2002 ) [RJL: This is from $PH/COOL-BDE/bde2java2/doc/html/ , 040223] -------------------------------------------------------------------------------- 1: package bde2java.client; 2: 3: /*********************************************************************** 4: * File: Bde2JavaApplet.java 5: * 6: * Creation Date: November 27, 2002 7: ***********************************************************************/ 8: 9: import java.awt.*; 10: import java.awt.event.*; 11: import java.util.Vector; 12: import javax.swing.*; 13: 14: 15: /** 16: * This is the main applet class for the Bde2Java application. It 17: * creates a GUIController and a RootPanel and delegates most other 18: * work to them. 19: * 20: * @author Dan Shea, Qiang Li 21: */ 22: public class Bde2JavaApplet extends JApplet { 23: public static boolean launchedAsApplication = false; 24: protected Bde2JavaGUIController controller = null; 25: protected Bde2JavaRootPanel rootPanel = null; 26: 27: public Bde2JavaApplet() { 28: super(); 29: } 30: 31: /** 32: * Providing a main method allows the applet to be run 33: * as an application 34: */ 35: public static void main(String args[]) { 36: JFrame appFrame = new JFrame("Bde2Java Version 2"); 37: appFrame.setSize(600, 300); 38: //appFrame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); 39: appFrame.addWindowListener(new WindowAdapter() { 40: public void windowClosing(WindowEvent e) { 41: System.exit(0); 42: } 43: }); 44: 45: launchedAsApplication = true; 46: 47: //Create an instance of the applet 48: Bde2JavaApplet bdeApplet = new Bde2JavaApplet(); 49: 50: //initialize and start the applet 51: bdeApplet.init(); 52: bdeApplet.start(); 53: 54: //Add applet to the frame 55: appFrame.getContentPane().add(bdeApplet, BorderLayout.CENTER); 56: //appFrame.pack(); 57: appFrame.setVisible(true); 58: 59: } 60: 61: public void init() { 62: setGUIController(new Bde2JavaGUIController(this)); 63: rootPanel = new Bde2JavaRootPanel(this); 64: getContentPane().add(rootPanel, BorderLayout.CENTER); 65: } 66: 67: public Bde2JavaRootPanel getRootPanel() { 68: return rootPanel; 69: } 70: 71: public Bde2JavaGUIController getGUIController() { 72: return controller; 73: } 74: 75: public void setGUIController(Bde2JavaGUIController newController) { 76: controller = newController; 77: } 78: 79: /** 80: * This method will enable/disable the UI base on the boolean 81: * parameter passed in. When the UI is disabled the system's 82: * default cursor will be shown (typically the hourglass). 83: */ 84: public void enableUI(boolean enable) { 85: if (enable) { 86: getGlassPane().setVisible(false); 87: getGlassPane().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); 88: } 89: else { 90: getGlassPane().setVisible(true); 91: getGlassPane().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); 92: } 93: } 94: } -------------------------------------------------------------------------------- Html form generated by Xref-Java2Html version 1.4.0 on Tue Dec 17 23:21:09 2002