home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-05-08 | 6.0 KB | 159 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 reason for credit denial
- //--------------------------------------------------------------------------------------------------
-
- 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.*;
-
- /**
- * ApplicationDeniedPanel displays a reason to the applicant for
- * not being approved.
- */
- public class ApplicationDeniedPanel extends BevelPanel {
- Label label1 = new Label();
- ImageControl imageControl1 = new ImageControl();
- Label label2 = new Label();
- Label label3 = new Label();
- TextFieldControl textReason = 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();
- BorderLayout borderLayout2 = new BorderLayout();
- GridBagLayout gridBagLayout5 = new GridBagLayout();
- BorderLayout borderLayout3 = new BorderLayout();
- ResourceBundle res = Res.getBundle("borland.reference.creditapproval.client.Res");
-
- /**
- /* Default constructor - placed here for the sake of JavaBean compliance
- */
- public ApplicationDeniedPanel() {
- try {
- jbInit();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Construct the Panel by invoking jbInit
- */
- public ApplicationDeniedPanel(CreditApprovalApplet creditApp) {
- theApplet = creditApp;
- try {
- jbInit();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Invoked by the Applet to set the Reason Text
- */
- public void setReason( String reason ) {
- textReason.setText( reason );
- }
-
- /**
- * Initialize the Panel
- */
- private void jbInit() throws Exception{
- this.setSize(new Dimension(318, 342));
- 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("Sorry!"));
- 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("Your_application_for"));
- label3.setFont(new Font("Dialog", 1, 12));
- label3.setAlignment(1);
- label3.setText(res.getString("been_denied_for_the") + ":" );
- textReason.setEditable(false);
- buttonControl1.setLabel(res.getString("OK"));
- buttonControl1.addActionListener(new ApplicationDeniedPanel_buttonControl1_actionAdapter(this));
- bevelPanel4.setLayout(gridBagLayout5);
- bevelPanel3.setLayout(gridBagLayout4);
- bevelPanel1.setLayout(gridBagLayout3);
- bevelPanel2.setLayout(flowLayout1);
- 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(textReason, 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), 250, 0));
- }
-
- void buttonControl1_actionPerformed(ActionEvent e) {
- if (theApplet != null)
- theApplet.destroyApplet();
- }
-
- }
-
- class ApplicationDeniedPanel_buttonControl1_actionAdapter implements java.awt.event.ActionListener{
- ApplicationDeniedPanel adaptee;
-
- ApplicationDeniedPanel_buttonControl1_actionAdapter(ApplicationDeniedPanel adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(ActionEvent e) {
- adaptee.buttonControl1_actionPerformed(e);
- }
- }
-
-
-