⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 orderentryframe.java

📁 java在线商店的源代码。编写十分规范的哦
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
/**
 * Copyright (c) 1996-2004 Borland Software Corporation.  All Rights Reserved.
 * 
 * This SOURCE CODE FILE, which has been provided by Borland Software as part
 * of a Borland Software product for use ONLY by licensed users of the product,
 * includes CONFIDENTIAL and PROPRIETARY information of Borland Software.  
 *
 * 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 SOFTWARE, 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.
 */
//------------------------------------------------------------------------------
// Copyright (c) 1996-2004 Borland Software Corporation.  All Rights Reserved.
//------------------------------------------------------------------------------

package com.borland.samples.orderentry;

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;

import com.borland.dbswing.*;
import com.borland.dx.dataset.*;
import com.borland.dx.sql.dataset.*;
import com.borland.dx.text.Alignment;

/**
 * OrderEntryFrame is the Frame subclass that is used to view, insert, and
 * update Order records.
 *
 */
public class OrderEntryFrame extends JFrame {
  private static DataModule1 dm = DataModule1.getDataModule();
  private static OrderEntryFrame myOrderEntryFrame;
  JPanel contentPane;
  private QueryDataSet qdsOrder;
  private QueryDataSet qdsOrderItem;
  private QueryDataSet qdsPayMethod;
  private QueryDataSet qdsShipMethod;
  private QueryDataSet qdsStatus;
  private QueryDataSet qdsCustomer;
  private QueryDataSet qdsProduct;
  JPanel pnlTop = new JPanel();
  JPanel pnlNavigator = new JPanel();
  JPanel pnlDate = new JPanel();
  JPanel pnlOrder = new JPanel();
  JPanel pnlBillTo = new JPanel();
  JPanel pnlShipTo = new JPanel();
  JPanel pnlMiddle = new JPanel();
  JPanel pnlOrderInfo = new JPanel();
  JPanel pnlOrderItems = new JPanel();
  JPanel pnlBottom = new JPanel();
  JPanel pnlButtons = new JPanel();
  JdbLabel txtID = new JdbLabel();
  JdbTextField txtOrderTrackNum = new JdbTextField();
  JdbTextField txtCustomerPONum = new JdbTextField();
  JdbTextField txtOrderDate = new JdbTextField();
  JdbTextField txtCustomerName = new JdbTextField();
  JdbTextField txtCustomerID = new JdbTextField();
  JdbTextField txtBillAddr1 = new JdbTextField();
  JdbTextField txtBillAddr2 = new JdbTextField();
  JdbTextField txtBillCity = new JdbTextField();
  JdbTextField txtBillState = new JdbTextField();
  JdbTextField txtBillPostalCode = new JdbTextField();
  JdbTextField txtBillCountry = new JdbTextField();
  JdbTextField txtShipName = new JdbTextField();
  JdbTextField txtShipAddr1 = new JdbTextField();
  JdbTextField txtShipAddr2 = new JdbTextField();
  JdbTextField txtShipCity = new JdbTextField();
  JdbTextField txtShipState = new JdbTextField();
  JdbTextField txtShipPostalCode = new JdbTextField();
  JdbTextField txtShipCountry = new JdbTextField();
  JdbTextField txtCreditCardNum= new JdbTextField();
  JdbComboBox cboPayMethod = new JdbComboBox();
  JdbComboBox cboShipMethod = new JdbComboBox();
  JdbComboBox cboStatus = new JdbComboBox();
  JdbTextField txtShipDate = new JdbTextField();
  JLabel lblID = new JLabel();
  JLabel lblDate = new JLabel();
  JLabel lblOrderTrackNum = new JLabel();
  JLabel lblCustomerPONum = new JLabel();
  JLabel lblShipDate = new JLabel();
  JLabel lblBillTo = new JLabel();
  JLabel lblShipTo = new JLabel();
  JLabel lblCreditCardNum = new JLabel();
  JLabel lblPayMethod = new JLabel();
  JLabel lblShipMethod = new JLabel();
  JLabel lblStatus = new JLabel();
  GridBagLayout gridBagLayout3 = new GridBagLayout();
  GridBagLayout gridBagLayout2 = new GridBagLayout();
  GridBagLayout gridBagLayout5 = new GridBagLayout();
  GridBagLayout gridBagLayout6 = new GridBagLayout();
  BorderLayout borderLayout1 = new BorderLayout();
  BorderLayout borderLayout2 = new BorderLayout();
  BorderLayout borderLayout3 = new BorderLayout();
  JdbTable tblOrderItems = new JdbTable();
  JScrollPane jScrollPane1 = new JScrollPane();
  JButton btnSave = new JButton();
  JButton btnCancel = new JButton();
  JButton btnClose = new JButton();
  GridBagLayout gridBagLayout9 = new GridBagLayout();
  GridBagLayout gridBagLayout4 = new GridBagLayout();
  JPanel pnlTotals = new JPanel();
  JLabel lblSubTotal = new JLabel();
  JLabel lblTax = new JLabel();
  JLabel lblShipping = new JLabel();
  JLabel lblAmtPaid = new JLabel();
  JLabel lblAmtDue = new JLabel();
  JdbTextField txtSubTotal = new JdbTextField();
  JdbTextField txtTax = new JdbTextField();
  JdbTextField txtTaxPercent = new JdbTextField();
  JdbTextField txtShipping = new JdbTextField();
  JdbTextField txtShipPercent = new JdbTextField();
  JdbTextField txtAmtPaid = new JdbTextField();
  JdbTextField txtAmtDue = new JdbTextField();
  JdbNavToolBar jdbNavToolBar1 = new JdbNavToolBar();
  JdbStatusLabel statusBarOrder = new JdbStatusLabel();
  JdbStatusLabel statusBarOrderItem = new JdbStatusLabel();
  JdbLabel imgLogo = new JdbLabel();
  JButton btnFindCustomer = new JButton();
  JButton btnNewCustomer = new JButton();
  GridBagLayout gridBagLayout7 = new GridBagLayout();
  JPanel pnlBillToButtons = new JPanel();
  GridBagLayout gridBagLayout8 = new GridBagLayout();
  GridBagLayout gridBagLayout10 = new GridBagLayout();
  JButton btnSaveShipTo = new JButton();
  JPanel pnlOrderItemStatus = new JPanel();
  JButton btnAddOrderItem = new JButton();
  JButton btnRemoveOrderItem = new JButton();
  GridBagLayout gridBagLayout11 = new GridBagLayout();
  JPanel pnlOrderItemButtons = new JPanel();
  JLabel lblOrderItemStatus = new JLabel();
  ResourceBundle res = Res.getBundle("com.borland.samples.orderentry.Res");
  GridBagLayout gridBagLayout12 = new GridBagLayout();
  GridBagLayout gridBagLayout13 = new GridBagLayout();
  GridLayout gridLayout1 = new GridLayout();

  /**
   * The constructor is public, but you should use the getOrderEntryFrame
   * method to get an instance of this class.
   */
  public OrderEntryFrame() {
    try {
      jbInit();    // initialize frame's controls (JBuilder designer)
      initData();  // initialize default data-aware component values.
    }
    catch (Exception e) {
      e.printStackTrace();
    };
  }

  /**
   * Method generated and maintained by JBuilder designer to initialize control
   * properties.
   *
   * @throws Exception exception
   */
  private void jbInit() throws Exception{
    contentPane = (JPanel) this.getContentPane();
    this.setSize(new Dimension(600, 600));
    this.setTitle(res.getString("OEF_Orders"));
    this.addWindowListener(new java.awt.event.WindowAdapter() {
      public void windowClosing(WindowEvent e) {
        this_windowClosing(e);
      }
    });
    pnlShipTo.setLayout(gridBagLayout6);
    pnlOrder.setLayout(gridBagLayout5);
    pnlBillTo.setLayout(gridBagLayout3);
    pnlOrderInfo.setLayout(gridBagLayout4);
    pnlBottom.setLayout(gridBagLayout10);
    pnlOrderItems.setLayout(borderLayout3);
    pnlMiddle.setLayout(borderLayout2);
    pnlTop.setLayout(gridBagLayout2);
    pnlDate.setLayout(gridLayout1);
    pnlNavigator.setLayout(gridBagLayout8);
    lblBillTo.setText(res.getString("OEF_Bill_To"));
    lblShipTo.setText(res.getString("OEF_Ship_To"));
    lblDate.setText(res.getString("OEF_Date"));
    lblCreditCardNum.setText(res.getString("OEF_Credit_Card_No"));
    lblPayMethod.setText(res.getString("OEF_Payment_Method"));
    lblShipMethod.setText(res.getString("OEF_Ship_Via"));
    lblStatus.setText(res.getString("OEF_Status"));
    tblOrderItems.setDataSet(dm.getOrderItemDataSet());
    txtCustomerName.setColumnName("CUSTOMERNAME");
    txtCustomerName.setDataSet(dm.getOrderDataSet());
    txtCustomerName.setEditable(false);
    txtCustomerID.setColumnName("CUSTOMERID");
    txtCustomerID.setDataSet(dm.getOrderDataSet());
    txtCustomerID.setEditable(false);
    txtBillAddr1.setColumnName("BILLADDR1");
    txtBillAddr1.setDataSet(dm.getOrderDataSet());
    txtBillAddr1.setEditable(false);
    txtBillAddr2.setColumnName("BILLADDR2");
    txtBillAddr2.setDataSet(dm.getOrderDataSet());
    txtBillAddr2.setEditable(false);
    txtBillCity.setColumnName("BILLCITY");
    txtBillCity.setDataSet(dm.getOrderDataSet());
    txtBillCity.setEditable(false);
    txtBillState.setColumnName("BILLSTATE");
    txtBillState.setDataSet(dm.getOrderDataSet());
    txtBillState.setEditable(false);
    txtBillPostalCode.setColumnName("BILLPOSTALCODE");
    txtBillPostalCode.setDataSet(dm.getOrderDataSet());
    txtBillPostalCode.setEditable(false);
    txtBillCountry.setColumnName("BILLCOUNTRY");
    txtBillCountry.setDataSet(dm.getOrderDataSet());
    txtBillCountry.setEditable(false);
    txtShipName.setColumnName("SHIPNAME");
    txtShipName.setDataSet(dm.getOrderDataSet());
    txtShipAddr1.setColumnName("SHIPADDR1");
    txtShipAddr1.setDataSet(dm.getOrderDataSet());
    txtShipAddr2.setColumnName("SHIPADDR2");
    txtShipAddr2.setDataSet(dm.getOrderDataSet());
    txtShipCity.setColumnName("SHIPCITY");
    txtShipCity.setDataSet(dm.getOrderDataSet());
    txtShipState.setColumnName("SHIPSTATE");
    txtShipState.setDataSet(dm.getOrderDataSet());
    txtShipPostalCode.setColumnName("SHIPPOSTALCODE");
    txtShipPostalCode.setDataSet(dm.getOrderDataSet());
    txtShipCountry.setColumnName("SHIPCOUNTRY");
    txtShipCountry.setDataSet(dm.getOrderDataSet());
    txtCreditCardNum.setColumnName("CREDITCARDNUM");
    txtCreditCardNum.setDataSet(dm.getOrderDataSet());
    cboPayMethod.setColumnName("PAYMETHOD");
    cboPayMethod.setDataSet(dm.getOrderDataSet());
    cboShipMethod.setColumnName("SHIPMETHOD");
    cboShipMethod.setDataSet(dm.getOrderDataSet());
    cboStatus.setColumnName("STATUS");
    cboStatus.setDataSet(dm.getOrderDataSet());
    txtShipDate.setColumnName("SHIPDATE");
    txtShipDate.setDataSet(dm.getOrderDataSet());
    cboPayMethod.addItemListener(new java.awt.event.ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        cboPayMethod_itemStateChanged(e);
      }
    });
    pnlButtons.setLayout(gridBagLayout9);
    btnSave.setText(res.getString("OEF_Save"));
    btnSave.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(ActionEvent e) {
        btnSave_actionPerformed(e);
      }
    });
    btnCancel.setText(res.getString("OEF_Cancel"));
    btnCancel.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(ActionEvent e) {
        btnCancel_actionPerformed(e);
      }
    });
    btnClose.setText(res.getString("OEF_Close"));
    btnClose.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(ActionEvent e) {
        btnClose_actionPerformed(e);
      }
    });
    pnlTotals.setLayout(gridBagLayout7);
    lblSubTotal.setText(res.getString("OEF_SubTotal"));
    lblTax.setText(res.getString("OEF_Tax"));
    lblShipping.setText(res.getString("OEF_Shipping"));
    lblAmtPaid.setText(res.getString("OEF_Paid"));
    lblAmtDue.setText(res.getString("OEF_Due"));
    txtSubTotal.setColumnName("SUBTOTAL");
    txtSubTotal.setDataSet(dm.getOrderItemDataSet());
    txtTax.setColumnName("TAX");
    txtTax.setDataSet(dm.getOrderItemDataSet());
    txtTaxPercent.setText(String.valueOf(dm.TAXPERCENT));
    txtTaxPercent.setEditable(false);
    txtShipping.setColumnName("SHIPPING");
    txtShipping.setDataSet(dm.getOrderItemDataSet());
    txtShipPercent.setText(String.valueOf(dm.SHIPPERCENT));
    txtShipPercent.setEditable(false);
    txtAmtPaid.setColumnName("AMTPAID");
    txtAmtPaid.setDataSet(dm.getOrderDataSet());
    txtAmtDue.setColumnName("AMTDUE");
    txtAmtDue.setDataSet(dm.getOrderItemDataSet());
    jdbNavToolBar1.setDataSet(dm.getOrderDataSet());
    jdbNavToolBar1.setButtonStateCancel(JdbNavToolBar.HIDDEN);
    jdbNavToolBar1.setButtonStatePost(JdbNavToolBar.HIDDEN);
    jdbNavToolBar1.setButtonStateDitto(JdbNavToolBar.HIDDEN);
    jdbNavToolBar1.setButtonStateSave(JdbNavToolBar.HIDDEN);
    jdbNavToolBar1.setButtonStateRefresh(JdbNavToolBar.HIDDEN);
    jdbNavToolBar1.setFloatable(false);
    lblID.setText(res.getString("OEF_Order_No"));
    txtID.setColumnName("ID");
    txtID.setDataSet(dm.getOrderDataSet());
    txtID.setForeground(Color.red);
    txtOrderTrackNum.setColumnName("ORDERTRACKNUM");
    txtOrderTrackNum.setDataSet(dm.getOrderDataSet());
    txtCustomerPONum.setColumnName("CUSTOMERPONUM");
    txtCustomerPONum.setDataSet(dm.getOrderDataSet());
    txtOrderDate.setColumnName("ORDERDATE");

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -