home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-05-08 | 23.3 KB | 695 lines |
- /*
- * Copyright (c) 1997-1998 Borland International, Inc. All Rights Reserved.
- *
- * This SOURCE CODE FILE, which has been provided by Borland as part
- * of a Borland product for use ONLY by licensed users of the product,
- * includes CONFIDENTIAL and PROPRIETARY information of Borland.
- *
- * USE OF THIS SOFTWARE IS GOVERNED BY THE TERMS AND CONDITIONS
- * OF THE LICENSE STATEMENT AND LIMITED WARRANTY FURNISHED WITH
- * THE PRODUCT.
- *
- * IN PARTICULAR, YOU WILL INDEMNIFY AND HOLD BORLAND, ITS RELATED
- * COMPANIES AND ITS SUPPLIERS, HARMLESS FROM AND AGAINST ANY CLAIMS
- * OR LIABILITIES ARISING OUT OF THE USE, REPRODUCTION, OR DISTRIBUTION
- * OF YOUR PROGRAMS, INCLUDING ANY CLAIMS OR LIABILITIES ARISING OUT OF
- * OR RESULTING FROM THE USE, MODIFICATION, OR DISTRIBUTION OF PROGRAMS
- * OR FILES CREATED FROM, BASED ON, AND/OR DERIVED FROM THIS SOURCE
- * CODE FILE.
- */
-
- //Title: Cliffhanger Adventure Gear
- //Version:
- //Copyright: Copyright (c) 1997 Borland International, Inc.
- //Author: Application Methods, Inc.
- //Description: Cliffhanger Adventure Gear order entry system
-
- package borland.reference.cliffhanger;
-
- import java.awt.*;
- import java.awt.event.*;
- import borland.jbcl.control.*;
- import borland.jbcl.layout.*;
- import java.util.*;
-
- /**
- * MainFrame is the main window of the Cliffhanger Application.
- * This class implements a button menu to navigate to other
- * functional areas of the application.
- * During instantiation of this class, an attempt to make the database
- * connection is made, and shuts down the application if the connection fails.
- */
- public class MainFrame extends DecoratedFrame {
- BorderLayout borderLayout1 = new BorderLayout();
- BevelPanel bevelPanel1 = new BevelPanel();
- MenuBar menuBar1 = new MenuBar();
- Menu menuFile = new Menu();
- MenuItem menuFileExit = new MenuItem();
- Menu menuHelp = new Menu();
- MenuItem menuHelpAbout = new MenuItem();
- StatusBar statusBar = new StatusBar();
- BevelPanel bevelPanel2 = new BevelPanel();
- GridBagLayout gridBagLayout1 = new GridBagLayout();
- ButtonControl btnOrders = new ButtonControl();
- ButtonControl btnCustomers = new ButtonControl();
- ButtonControl btnProducts = new ButtonControl();
- ButtonControl btnCategories = new ButtonControl();
- ButtonControl btnExit = new ButtonControl();
- ImageControl imgLogo = new ImageControl();
- BorderLayout borderLayout2 = new BorderLayout();
- BorderLayout borderLayout3 = new BorderLayout();
- PopupMenu pumOrder = new PopupMenu();
- MenuItem pumNewOrder = new MenuItem();
- MenuItem pumFindOrder = new MenuItem();
- PopupMenu pumCustomer = new PopupMenu();
- PopupMenu pumProduct = new PopupMenu();
- MenuItem pumNewCustomer = new MenuItem();
- MenuItem pumFindCustomer = new MenuItem();
- MenuItem pumNewProduct = new MenuItem();
- MenuItem pumFindProduct = new MenuItem();
- ResourceBundle res = Res.getBundle("borland.reference.cliffhanger.Res");
-
- //Construct the frame
- public MainFrame() {
- try {
- jbInit();
- initData();
- }
- catch (Exception e) {
- borland.jbcl.util.Diagnostic.printStackTrace(e);
- };
- }
-
- //Component initialization
- private void jbInit() throws Exception{
- this.setLayout(borderLayout1);
- this.setTitle(res.getString("MF_Cliffhanger_Title"));
- bevelPanel1.setLayout(borderLayout3);
- menuFile.setLabel(res.getString("MF_File"));
- menuFileExit.setLabel(res.getString("MF_Exit"));
- menuFileExit.addActionListener(new MainFrame_menuFileExit_ActionAdapter(this));
- menuHelp.setLabel(res.getString("MF_Help"));
- menuHelpAbout.setLabel(res.getString("MF_About"));
- statusBar.setBevelOuter(BevelPanel.LOWERED);
- bevelPanel2.setMargins(new Insets(5, 5, 5, 5));
- btnOrders.setAlignment(borland.jbcl.util.Alignment.LEFT | borland.jbcl.util.Alignment.MIDDLE);
- btnOrders.setActionCommand(res.getString("MF_Orders"));
- btnOrders.setImageName(".\\graphics\\orders.gif");
- btnOrders.setLabel(res.getString("MF_Orders"));
- btnOrders.addMouseListener(new MainFrame_btnOrders_mouseAdapter(this));
- btnOrders.addActionListener(new MainFrame_btnOrders_actionAdapter(this));
- btnCustomers.setAlignment(borland.jbcl.util.Alignment.LEFT | borland.jbcl.util.Alignment.MIDDLE);
- btnCustomers.setActionCommand("Customers");
- btnCustomers.setImageName(".\\graphics\\customers.gif");
- btnCustomers.setLabel(res.getString("MF_Customers"));
- btnCustomers.addMouseListener(new MainFrame_btnCustomers_mouseAdapter(this));
- btnCustomers.addActionListener(new MainFrame_btnCustomers_actionAdapter(this));
- btnProducts.setAlignment(borland.jbcl.util.Alignment.LEFT | borland.jbcl.util.Alignment.MIDDLE);
- btnProducts.setActionCommand(res.getString("MF_Products"));
- btnProducts.setImageName(".\\graphics\\Products.gif");
- btnProducts.setLabel(res.getString("MF_Products"));
- btnProducts.addMouseListener(new MainFrame_btnProducts_mouseAdapter(this));
- btnProducts.addActionListener(new MainFrame_btnProducts_actionAdapter(this));
- btnCategories.setAlignment(borland.jbcl.util.Alignment.LEFT | borland.jbcl.util.Alignment.MIDDLE);
- btnCategories.setActionCommand("");
- btnCategories.setImageName(".\\graphics\\categories.gif");
- btnCategories.setLabel(res.getString("MF_Categories"));
- btnCategories.addMouseListener(new MainFrame_btnCategories_mouseAdapter(this));
- btnCategories.addActionListener(new MainFrame_btnCategories_actionAdapter(this));
- btnExit.setAlignment(borland.jbcl.util.Alignment.LEFT | borland.jbcl.util.Alignment.MIDDLE);
- btnExit.setActionCommand("");
- btnExit.setImageName(".\\graphics\\exit.gif");
- btnExit.setLabel(res.getString("MF_Exit"));
- btnExit.addMouseListener(new MainFrame_btnExit_mouseAdapter(this));
- btnExit.addActionListener(new MainFrame_btnExit_actionAdapter(this));
- imgLogo.setAlignment(borland.jbcl.util.Alignment.LEFT | borland.jbcl.util.Alignment.TOP);
- imgLogo.setImageName(".\\Graphics\\logo.gif");
- pumNewOrder.setLabel(res.getString("MF_New_Order"));
- pumNewOrder.addActionListener(new MainFrame_pumNewOrder_ActionAdapter(this));
- pumFindOrder.setLabel(res.getString("MF_Find_Order"));
- pumFindOrder.addActionListener(new MainFrame_pumFindOrder_ActionAdapter(this));
- pumNewCustomer.setLabel(res.getString("MF_New_Customer"));
- pumNewCustomer.addActionListener(new MainFrame_pumNewCustomer_ActionAdapter(this));
- pumFindCustomer.setLabel(res.getString("MF_Find_Customer"));
- pumFindCustomer.addActionListener(new MainFrame_pumFindCustomer_ActionAdapter(this));
- pumNewProduct.setLabel(res.getString("MF_New_Product"));
- pumNewProduct.addActionListener(new MainFrame_pumNewProduct_ActionAdapter(this));
- pumFindProduct.setLabel(res.getString("MF_Find_Product"));
- pumFindProduct.addActionListener(new MainFrame_pumFindProduct_ActionAdapter(this));
- bevelPanel2.setLayout(gridBagLayout1);
- menuHelpAbout.addActionListener(new MainFrame_menuHelpAbout_ActionAdapter(this));
- menuFile.add(menuFileExit);
- menuHelp.add(menuHelpAbout);
- menuBar1.add(menuFile);
- menuBar1.add(menuHelp);
- this.setMenuBar(menuBar1);
- this.add(statusBar, BorderLayout.SOUTH);
- this.add(bevelPanel1, BorderLayout.CENTER);
- bevelPanel1.add(imgLogo, BorderLayout.CENTER);
- this.add(bevelPanel2, BorderLayout.WEST);
- bevelPanel2.add(btnOrders, new GridBagConstraints2(0, 1, 1, 1, 100.0, 100.0
- ,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 70, 0));
- bevelPanel2.add(btnCustomers, new GridBagConstraints2(0, 2, 1, 1, 100.0, 100.0
- ,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
- bevelPanel2.add(btnProducts, new GridBagConstraints2(0, 3, 1, 1, 100.0, 100.0
- ,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
- bevelPanel2.add(btnCategories, new GridBagConstraints2(0, 4, 1, 1, 100.0, 100.0
- ,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
- bevelPanel2.add(btnExit, new GridBagConstraints2(0, 5, 1, 1, 100.0, 100.0
- ,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
- pumOrder.add(pumNewOrder);
- pumOrder.add(pumFindOrder);
- pumCustomer.add(pumNewCustomer);
- pumCustomer.add(pumFindCustomer);
- pumProduct.add(pumNewProduct);
- pumProduct.add(pumFindProduct);
-
- }
-
- /**
- * Instantiate a local instance of DataModule1 to
- * Connect to the database which will prompt
- * the user to login.
- * This way, the user will be prompted to login
- * only at startup (when the main form is created).
- */
- private void initData() {
- DataModule1 dm = DataModule1.getDataModule();
- try {
- dm.dbConnect();
- }
- catch (Exception ex) {
- ex.printStackTrace();
- // If the user fails to connect to the database
- // show the error message and exit the program.
- String msg = res.getString("MF_DBConnect_Failed");
- CliffhangerApplication.messageDlg(res.getString("MF_Error"),
- msg,
- Message.OK);
- System.exit(0);
- }
- }
-
- /**
- * Menu File | Exit action performed event handler
- * Close the applcation.
- */
- public void fileExit_actionPerformed(ActionEvent e) {
- System.exit(0);
- }
-
- /**
- * Menu Help | About action performed event handler.
- * Show the About Box for the application.
- */
- public void helpAbout_actionPerformed(ActionEvent e) {
- MainFrame_AboutBox dlg = new MainFrame_AboutBox(this);
- Dimension dlgSize = dlg.getPreferredSize();
- Dimension frmSize = getSize();
- Point loc = getLocation();
- dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
- dlg.setModal(true);
- dlg.show();
- }
-
- /**
- * When the Orders button is clicked, show the Orders popup menu.
- */
- void btnOrders_actionPerformed(java.awt.event.ActionEvent e) {
- bevelPanel2.add(pumOrder);
- pumOrder.show(bevelPanel2, btnOrders.getSize().width, btnOrders.getLocation().y);
- }
-
- /**
- * When the Customers button is clicked, show the Customers popup menu.
- */
- void btnCustomers_actionPerformed(java.awt.event.ActionEvent e) {
- bevelPanel2.add(pumCustomer);
- pumCustomer.show(bevelPanel2, btnCustomers.getSize().width, btnCustomers.getLocation().y);
- }
-
- /**
- * When the Products button is clicked, show the Products popup menu.
- */
- void btnProducts_actionPerformed(java.awt.event.ActionEvent e) {
- bevelPanel2.add(pumProduct);
- pumProduct.show(bevelPanel2, btnProducts.getSize().width, btnProducts.getLocation().y);
- }
-
- /**
- * When the Categories button is clicked, show the Categories form.
- * Note: There is no Categories popup menu.
- */
- void btnCategories_actionPerformed(java.awt.event.ActionEvent e) {
- DecoratedFrame frame = CategoryFrame.getCategoryFrame();
- CliffhangerApplication.showCenteredFrame(frame, false);
- }
-
- /**
- * When the Exit button is clicked, close the application.
- */
- void btnExit_actionPerformed(java.awt.event.ActionEvent e) {
- System.exit(0);
- }
-
-
- /**
- * When the New Order menu item is clicked, show the Order Entry form,
- * And insert a new Order record.
- */
- void pumNewOrder_actionPerformed(java.awt.event.ActionEvent e) {
- OrderEntryFrame frame = OrderEntryFrame.getOrderEntryFrame();
- CliffhangerApplication.showCenteredFrame(frame, false);
- frame.newOrder();
- }
-
- /**
- * When the Find Order menu is clicked, show the Find Order form.
- */
- void pumFindOrder_actionPerformed(java.awt.event.ActionEvent e) {
- DecoratedFrame frame = OrderFindFrame.getOrderFindFrame();
- CliffhangerApplication.showCenteredFrame(frame, false);
- }
-
-
- /**
- * When the New Customer menu item is clicked, show the Customer form,
- * And insert a new customer record.
- */
- void pumNewCustomer_actionPerformed(java.awt.event.ActionEvent e) {
- CustomerFrame frame = CustomerFrame.getCustomerFrame();
- CliffhangerApplication.showCenteredFrame(frame, false);
- frame.newCustomer();
- }
-
- /**
- * When the Find Customer menu is clicked, show the Find Customer form.
- */
- void pumFindCustomer_actionPerformed(java.awt.event.ActionEvent e) {
- DecoratedFrame frame = CustomerFindFrame.getCustomerFindFrame();
- CliffhangerApplication.showCenteredFrame(frame, false);
- }
-
-
- /**
- * When the New Product menu item is clicked, show the Product form,
- * And insert a new Product record.
- */
- void pumNewProduct_actionPerformed(java.awt.event.ActionEvent e) {
- ProductFrame frame = ProductFrame.getProductFrame();
- CliffhangerApplication.showCenteredFrame(frame, false);
- frame.newProduct();
- }
-
- /**
- * When the Find Product menu is clicked, show the Find Product form.
- */
- void pumFindProduct_actionPerformed(java.awt.event.ActionEvent e) {
- DecoratedFrame frame = ProductFindFrame.getProductFindFrame();
- CliffhangerApplication.showCenteredFrame(frame, false);
- }
-
- //.....................................................
- /**
- * The following methods are event handlers for
- * showing a hint in the statusBar when the user
- * places the mouse over the buttons on the Main Frame.
- */
- void btnOrders_mouseEntered(MouseEvent e) {
- statusBar.setText(res.getString("MF_Customer_Orders"));
- }
-
- void btnOrders_mouseExited(MouseEvent e) {
- statusBar.setText("");
- }
-
- void btnCustomers_mouseEntered(MouseEvent e) {
- statusBar.setText(res.getString("MF_Customer_Records"));
- }
-
- void btnCustomers_mouseExited(MouseEvent e) {
- statusBar.setText("");
- }
-
- void btnProducts_mouseEntered(MouseEvent e) {
- statusBar.setText(res.getString("MF_Cliffhanger_Products"));
- }
-
- void btnProducts_mouseExited(MouseEvent e) {
- statusBar.setText("");
- }
-
- void btnCategories_mouseEntered(MouseEvent e) {
- statusBar.setText(res.getString("MF_Product_Categories"));
- }
-
- void btnCategories_mouseExited(MouseEvent e) {
- statusBar.setText("");
- }
-
- void btnExit_mouseEntered(MouseEvent e) {
- statusBar.setText(res.getString("MF_Exit_Cliffhanger"));
- }
-
- void btnExit_mouseExited(MouseEvent e) {
- statusBar.setText("");
- }
- //.....................................................
-
- }
-
- class MainFrame_menuFileExit_ActionAdapter implements ActionListener{
- MainFrame adaptee;
-
- MainFrame_menuFileExit_ActionAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(ActionEvent e) {
- adaptee.fileExit_actionPerformed(e);
- }
- }
-
- class MainFrame_menuHelpAbout_ActionAdapter implements ActionListener{
- MainFrame adaptee;
-
- MainFrame_menuHelpAbout_ActionAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(ActionEvent e) {
- adaptee.helpAbout_actionPerformed(e);
- }
- }
-
- class MainFrame_btnOrders_actionAdapter implements java.awt.event.ActionListener{
- MainFrame adaptee;
-
- MainFrame_btnOrders_actionAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
- adaptee.btnOrders_actionPerformed(e);
- }
- }
-
- class MainFrame_btnCustomers_actionAdapter implements java.awt.event.ActionListener{
- MainFrame adaptee;
-
- MainFrame_btnCustomers_actionAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
- adaptee.btnCustomers_actionPerformed(e);
- }
- }
-
- class MainFrame_btnProducts_actionAdapter implements java.awt.event.ActionListener{
- MainFrame adaptee;
-
- MainFrame_btnProducts_actionAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
- adaptee.btnProducts_actionPerformed(e);
- }
- }
-
- class MainFrame_btnCategories_actionAdapter implements java.awt.event.ActionListener{
- MainFrame adaptee;
-
- MainFrame_btnCategories_actionAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
- adaptee.btnCategories_actionPerformed(e);
- }
- }
-
- class MainFrame_btnExit_actionAdapter implements java.awt.event.ActionListener{
- MainFrame adaptee;
-
- MainFrame_btnExit_actionAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
- adaptee.btnExit_actionPerformed(e);
- }
- }
-
- class MainFrame_pumNewOrder_ActionAdapter implements ActionListener{
- MainFrame adaptee;
-
- MainFrame_pumNewOrder_ActionAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
- adaptee.pumNewOrder_actionPerformed(e);
- }
- }
-
- class MainFrame_pumFindOrder_ActionAdapter implements ActionListener{
- MainFrame adaptee;
-
- MainFrame_pumFindOrder_ActionAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
- adaptee.pumFindOrder_actionPerformed(e);
- }
- }
-
- class MainFrame_pumNewCustomer_ActionAdapter implements ActionListener{
- MainFrame adaptee;
-
- MainFrame_pumNewCustomer_ActionAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
- adaptee.pumNewCustomer_actionPerformed(e);
- }
- }
-
- class MainFrame_pumFindCustomer_ActionAdapter implements ActionListener{
- MainFrame adaptee;
-
- MainFrame_pumFindCustomer_ActionAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
- adaptee.pumFindCustomer_actionPerformed(e);
- }
- }
-
- class MainFrame_pumNewProduct_ActionAdapter implements ActionListener{
- MainFrame adaptee;
-
- MainFrame_pumNewProduct_ActionAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
- adaptee.pumNewProduct_actionPerformed(e);
- }
- }
-
- class MainFrame_pumFindProduct_ActionAdapter implements ActionListener{
- MainFrame adaptee;
-
- MainFrame_pumFindProduct_ActionAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
- adaptee.pumFindProduct_actionPerformed(e);
- }
- }
-
- class MainFrame_btnOrders_mouseAdapter extends java.awt.event.MouseAdapter {
- MainFrame adaptee;
-
- MainFrame_btnOrders_mouseAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void mouseEntered(MouseEvent e) {
- adaptee.btnOrders_mouseEntered(e);
- }
-
- public void mouseExited(MouseEvent e) {
- adaptee.btnOrders_mouseExited(e);
- }
- }
-
- class MainFrame_btnCustomers_mouseAdapter extends java.awt.event.MouseAdapter {
- MainFrame adaptee;
-
- MainFrame_btnCustomers_mouseAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void mouseEntered(MouseEvent e) {
- adaptee.btnCustomers_mouseEntered(e);
- }
-
- public void mouseExited(MouseEvent e) {
- adaptee.btnCustomers_mouseExited(e);
- }
- }
-
- class MainFrame_btnProducts_mouseAdapter extends java.awt.event.MouseAdapter {
- MainFrame adaptee;
-
- MainFrame_btnProducts_mouseAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void mouseEntered(MouseEvent e) {
- adaptee.btnProducts_mouseEntered(e);
- }
-
- public void mouseExited(MouseEvent e) {
- adaptee.btnProducts_mouseExited(e);
- }
- }
-
- class MainFrame_btnCategories_mouseAdapter extends java.awt.event.MouseAdapter {
- MainFrame adaptee;
-
- MainFrame_btnCategories_mouseAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void mouseEntered(MouseEvent e) {
- adaptee.btnCategories_mouseEntered(e);
- }
-
- public void mouseExited(MouseEvent e) {
- adaptee.btnCategories_mouseExited(e);
- }
- }
-
- class MainFrame_btnExit_mouseAdapter extends java.awt.event.MouseAdapter {
- MainFrame adaptee;
-
- MainFrame_btnExit_mouseAdapter(MainFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void mouseEntered(MouseEvent e) {
- adaptee.btnExit_mouseEntered(e);
- }
-
- public void mouseExited(MouseEvent e) {
- adaptee.btnExit_mouseExited(e);
- }
- }
-
-
-
- /**
- * MainFrame_AboutBox is the About Box dialog for the Cliffhanger Application.
- * This class was originally generated by the Application Wizard.
- */
- class MainFrame_AboutBox extends Dialog implements ActionListener{
- Panel panel1 = new Panel();
- BevelPanel bevelPanel1 = new BevelPanel();
- InsetsPanel insetsPanel1 = new InsetsPanel();
- InsetsPanel insetsPanel2 = new InsetsPanel();
- InsetsPanel insetsPanel3 = new InsetsPanel();
- Button button1 = new Button();
- ImageControl imageControl1 = new ImageControl();
- Label label1 = new Label();
- Label label2 = new Label();
- Label label3 = new Label();
- Label label4 = new Label();
- Label label5 = new Label();
- BorderLayout borderLayout1 = new BorderLayout();
- BorderLayout borderLayout2 = new BorderLayout();
- FlowLayout flowLayout1 = new FlowLayout();
- GridLayout gridLayout1 = new GridLayout();
- ResourceBundle res = java.util.ResourceBundle.getBundle("borland.reference.cliffhanger.Res");
-
- String product = res.getString("AB_product");
- String version = res.getString("AB_version");
- String copyright = res.getString("AB_copyright");
- String comments = res.getString("AB_comments");
- String writtenby = res.getString("AB_writtenby");
-
- public MainFrame_AboutBox(Frame parent) {
- super(parent);
- try {
- jbInit();
- }
- catch (Exception e) {
- borland.jbcl.util.Diagnostic.printStackTrace(e);
- };
- pack();
- }
-
- void jbInit() throws Exception{
- this.setTitle(res.getString("MF_About"));
- setResizable(false);
- this.add(panel1, null);
- panel1.setLayout(borderLayout1);
- bevelPanel1.setLayout(borderLayout2);
- insetsPanel2.setLayout(flowLayout1);
- insetsPanel2.add(imageControl1, null);
- insetsPanel2.setInsets(new Insets(10, 10, 10, 10));
- bevelPanel1.add(insetsPanel2, BorderLayout.WEST);
- gridLayout1.setRows(5);
- gridLayout1.setColumns(1);
- label1.setText(product);
- label2.setText(version);
- label3.setText(copyright);
- label4.setText(comments);
- label5.setText(writtenby);
- insetsPanel3.setLayout(gridLayout1);
- insetsPanel3.add(label1, null);
- insetsPanel3.add(label2, null);
- insetsPanel3.add(label3, null);
- insetsPanel3.add(label4, null);
- insetsPanel3.add(label5, null);
- insetsPanel3.setInsets(new Insets(10, 60, 10, 10));
- bevelPanel1.add(insetsPanel3, BorderLayout.CENTER);
- button1.setLabel(res.getString("MF_OK"));
- button1.addActionListener(this);
- insetsPanel1.add(button1, null);
- panel1.add(insetsPanel1, BorderLayout.SOUTH);
- panel1.add(bevelPanel1, BorderLayout.NORTH);
- imageControl1.setAlignment(borland.jbcl.util.Alignment.LEFT | borland.jbcl.util.Alignment.TOP);
- imageControl1.setImageName(".\\Graphics\\logo_sml.gif");
- pack();
- }
-
- public void actionPerformed(ActionEvent e) {
- if (e.getSource() == button1) {
- setVisible(false);
- dispose();
- }
- }
- }
-
- class InsetsPanel extends Panel {
- protected Insets insets;
-
- public Insets getInsets() {
- return insets == null ? super.getInsets() : insets;
- }
-
- public void setInsets(Insets insets) {
- this.insets = insets;
- }
- }
-
-
-