home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-05-08 | 6.1 KB | 162 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.
- */
- //--------------------------------------------------------------------------------------------------
- // CORBA Reference Application
- // Copyright (c) 1997 by Borland International, All Rights Reserved
- //
- // Panel used to display System Error Information
- //--------------------------------------------------------------------------------------------------
-
- package borland.reference.creditapproval.client;
-
- import java.awt.*;
- import java.awt.event.*;
- import borland.jbcl.layout.*;
- import borland.jbcl.control.*;
- import java.util.*;
- import java.applet.*;
-
- /**
- * SystemErrorPanel displays system errors to the applicant
- */
- public class SystemErrorPanel extends Panel {
- Label label1 = new Label();
- ImageControl imageControl1 = new ImageControl();
- Label label2 = new Label();
- Label label3 = new Label();
- TextFieldControl textError = new TextFieldControl();
- ButtonControl buttonControl1 = new ButtonControl();
- private CreditApprovalApplet theApplet = null;
- BevelPanel bevelPanel1 = new BevelPanel();
- BevelPanel bevelPanel2 = new BevelPanel();
- FlowLayout flowLayout1 = new FlowLayout();
- BevelPanel bevelPanel3 = new BevelPanel();
- GridBagLayout gridBagLayout1 = new GridBagLayout();
- GridBagLayout gridBagLayout2 = new GridBagLayout();
- BorderLayout borderLayout1 = new BorderLayout();
- GridBagLayout gridBagLayout3 = new GridBagLayout();
- GridBagLayout gridBagLayout4 = new GridBagLayout();
- BevelPanel bevelPanel4 = new BevelPanel();
- GridBagLayout gridBagLayout5 = new GridBagLayout();
- BorderLayout borderLayout2 = new BorderLayout();
- BorderLayout borderLayout3 = new BorderLayout();
- ResourceBundle res = Res.getBundle("borland.reference.creditapproval.client.Res");
-
- /**
- /* Default constructor - placed here for the sake of JavaBean compliance
- */
- public SystemErrorPanel() {
- try {
- jbInit();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Construct the Panel by invoking jbInit
- */
- public SystemErrorPanel(CreditApprovalApplet creditApp) {
- theApplet = creditApp;
- try {
- jbInit();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Invoked by the applet to set the displayed error text
- */
- public void setError( String error ) {
- textError.setText( error );
- }
-
- /**
- * Initialize the Panel
- */
- private void jbInit() throws Exception{
- this.setSize(new Dimension(534, 280));
- this.setLayout(borderLayout3);
- label1.setForeground(Color.red);
- label1.setFont(new Font("Dialog", 1, 18));
- label1.setSize(new Dimension(607, 300));
- label1.setAlignment(1);
- label1.setText(res.getString("System_Error"));
- if (theApplet != null)
- imageControl1.setImageURL( new java.net.URL(theApplet.getImageLocation() + "logo.gif"));
- label2.setFont(new Font("Dialog", 1, 12));
- label2.setBounds(new Rectangle(0, 0, 0, 0));
- label2.setAlignment(1);
- label2.setText(res.getString("The_following_System"));
- label3.setFont(new Font("Dialog", 1, 12));
- label3.setAlignment(1);
- label3.setText(res.getString("the_processing_of"));
- textError.setEditable(false);
- buttonControl1.setLabel(res.getString("OK"));
- bevelPanel4.setLayout(gridBagLayout5);
- bevelPanel3.setLayout(gridBagLayout4);
- bevelPanel1.setLayout(gridBagLayout3);
- bevelPanel2.setLayout(flowLayout1);
- buttonControl1.addActionListener(new SystemErrorPanel_buttonControl1_actionAdapter(this));
- this.add(bevelPanel1, BorderLayout.SOUTH);
- bevelPanel1.add(buttonControl1, new GridBagConstraints2(0, 0, 2, 1, 0.0, 0.0
- ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(4, 0, 4, 0), 33, 0));
- this.add(bevelPanel3, BorderLayout.CENTER);
- bevelPanel3.add(label2, new GridBagConstraints2(0, 0, 1, 1, 0.0, 0.0
- ,GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(11, 0, 0, 0), 0, 0));
- bevelPanel3.add(label3, new GridBagConstraints2(0, 1, 1, 1, 0.0, 0.0
- ,GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- bevelPanel3.add(textError, new GridBagConstraints2(0, 2, 1, 1, 1.0, 1.0
- ,GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 8, 0, 8), 500155, 0));
- this.add(bevelPanel2, BorderLayout.EAST);
- bevelPanel2.add(imageControl1, null);
- this.add(bevelPanel4, BorderLayout.NORTH);
- bevelPanel4.add(label1, new GridBagConstraints2(0, 0, 1, 1, 0.0, 0.0
- ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- }
-
- /**
- * Re-display the application panel so that the user may submit
- * their application again.
- */
- void buttonControl1_actionPerformed(ActionEvent e) {
- if (theApplet != null)
- theApplet.displayApplication();
- }
- }
-
- /**
- * ActionListner Class used for the OK button
- */
- class SystemErrorPanel_buttonControl1_actionAdapter implements java.awt.event.ActionListener{
- SystemErrorPanel adaptee;
-
- SystemErrorPanel_buttonControl1_actionAdapter(SystemErrorPanel adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(ActionEvent e) {
- adaptee.buttonControl1_actionPerformed(e);
- }
- }
-