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

📄 mainframe.java~304~

📁 超值周末现场管理软件,用Excel存储数据
💻 JAVA~304~
📖 第 1 页 / 共 4 页
字号:
package main;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import common.Common;
import validation.RecordValidator;
import validation.*;
import service.*;
import bean.*;
import java.text.*;
import org.apache.commons.lang.*;
import org.apache.log4j.Logger;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 0.0
 */

public class MainFrame
    extends JFrame {



  ServiceObject so = new ServiceObject();

  LDLRecordValidator lrv = new LDLRecordValidator();
  FVORecordValidator frv = new FVORecordValidator();
  YZQRecordValidator yrv = new YZQRecordValidator();

  JPanel contentPane;
  BorderLayout borderLayout1 = new BorderLayout();
  JTabbedPane tabbedPane = new JTabbedPane();
  JPanel ldlPanel = new JPanel();
  GridBagLayout gridBagLayout1 = new GridBagLayout();

//labels
  JLabel ldlNameLbl = new JLabel();
  JLabel ldlTitle = new JLabel();
  JLabel ldlIDCardLbl = new JLabel();
  JLabel ldlAccountLbl = new JLabel();
  JLabel ldlAmountLbl = new JLabel();
  JLabel ldlAuthNumLbl = new JLabel();
  JLabel ldlDealDateLbl = new JLabel();

//txtfields
  JTextField ldlCustomerNameTxt = new JTextField();
  JTextField ldlCustomerIDCardTxt = new JTextField();
  JTextField ldlAccountTxt = new JTextField();
  JTextField ldlAmountTxt = new JTextField();
  JTextField ldlAuthNumTxt = new JTextField();
  JTextField ldlDealDateTxt = new JTextField();

//buttons
  JButton check_ldlIdcard_unique = new JButton();
  JButton check_ldlAccount_unique = new JButton();
  JButton ldl_ok = new JButton();
  JButton ldl_reset = new JButton();
  JLabel jLabel1 = new JLabel();
  JLabel jLabel2 = new JLabel();
  JLabel jLabel3 = new JLabel();
  JLabel jLabel4 = new JLabel();
  JLabel jLabel5 = new JLabel();
  JLabel jLabel6 = new JLabel();

  private final String dbError = "操作数据库时出错,请联系管理员";
  JLabel jLabel7 = new JLabel();
  JLabel fvoIDCardLbl = new JLabel();
  JTextField fvoCustomerNameTxt = new JTextField();
  JButton fvo_ok = new JButton();
  JLabel jLabel8 = new JLabel();
  JLabel jLabel9 = new JLabel();
  JLabel jLabel10 = new JLabel();
  GridBagLayout gridBagLayout2 = new GridBagLayout();
  JLabel fvoNameLbl = new JLabel();
  JLabel fvoAccountLbl = new JLabel();
  JTextField fvoCustomerIDCardTxt = new JTextField();
  JLabel fvoDealDateLbl = new JLabel();
  JLabel fvoTitle = new JLabel();
  JTextField fvoAuthNumTxt = new JTextField();
  JButton check_fvodcard_unique = new JButton();
  JTextField fvoAmountTxt = new JTextField();
  JTextField fvoAccountTxt = new JTextField();
  JButton fvo_reset = new JButton();
  JPanel fvoPanel = new JPanel();
  JButton check_fvoAccount_unique = new JButton();
  JLabel jLabel11 = new JLabel();
  JLabel fvoAmountLbl = new JLabel();
  JTextField fvoDealDateTxt = new JTextField();
  JLabel jLabel12 = new JLabel();
  JLabel fvoAuthNumLbl = new JLabel();
  JLabel jLabel13 = new JLabel();
  JLabel jLabel14 = new JLabel();
  JButton yzq_ok = new JButton();
  JLabel yzqTitle = new JLabel();
  GridBagLayout gridBagLayout3 = new GridBagLayout();
  JButton check_yzqdcard_unique = new JButton();
  JLabel yzqDealDateLbl = new JLabel();
  JTextField yzqAmountTxt = new JTextField();
  JLabel yzqIDCardLbl = new JLabel();
  JLabel jLabel15 = new JLabel();
  JTextField yzqAuthNumTxt = new JTextField();
  JButton yzq_reset = new JButton();
  JLabel jLabel16 = new JLabel();
  JLabel yzqAmountLbl = new JLabel();
  JLabel jLabel17 = new JLabel();
  JLabel yzqNameLbl = new JLabel();
  JTextField yzqAccountTxt = new JTextField();
  JTextField yzqCustomerNameTxt = new JTextField();
  JPanel yzqPanel = new JPanel();
  JButton check_yzqAccount_unique = new JButton();
  JTextField yzqCustomerIDCardTxt = new JTextField();
  JTextField yzqDealDateTxt = new JTextField();
  JLabel yzqAccountLbl = new JLabel();
  JLabel yzqAuthNumLbl = new JLabel();
  JLabel jLabel18 = new JLabel();
  JLabel yzqProductNameLbl = new JLabel();
  JComboBox yzqProductNameCmb = new JComboBox();

  //Construct the frame
  public MainFrame() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
      jbInit();
    }
    catch (Exception e) {
      e.printStackTrace();

    }
  }

  //Component initialization
  private void jbInit() throws Exception {
    contentPane = (JPanel)this.getContentPane();
    contentPane.setLayout(borderLayout1);
    this.setFont(new java.awt.Font("黑体", 0, 12));
    this.setLocale(java.util.Locale.getDefault());
    this.setSize(new Dimension(640, 480));
    this.setState(Frame.NORMAL);
    this.setTitle("超值周末");

    ldlTitle.setFont(new java.awt.Font("黑体", 0, 20));
    ldlTitle.setText("来店礼登记");

    tabbedPane.setFont(new java.awt.Font("黑体", 0, 14));
    ldlPanel.setLayout(gridBagLayout1);

    //labels
    ldlNameLbl.setFont(new java.awt.Font("黑体", 0, 14));
    ldlNameLbl.setText("姓名");
    ldlIDCardLbl.setFont(new java.awt.Font("黑体", 0, 14));
    ldlIDCardLbl.setText("身份证号");
    ldlAccountLbl.setFont(new java.awt.Font("黑体", 0, 14));
    ldlAccountLbl.setText("银行卡号");
    ldlAmountLbl.setFont(new java.awt.Font("黑体", 0, 14));
    ldlAmountLbl.setText("刷卡单金额");
    ldlAuthNumLbl.setFont(new java.awt.Font("黑体", 0, 14));
    ldlAuthNumLbl.setText("刷卡单授权号");
    ldlDealDateLbl.setFont(new java.awt.Font("黑体", 0, 14));
    ldlDealDateLbl.setText("刷卡交易日期");

    //fields

    String todayString = Common.getInstance().getDateFormat().format(new Date());
    ldlDealDateTxt.setText(todayString);

    //buttons
    check_ldlIdcard_unique.setFont(new java.awt.Font("黑体", 0, 14));
    check_ldlIdcard_unique.setText("检查身份证号是否唯一");
    check_ldlAccount_unique.setFont(new java.awt.Font("黑体", 0, 14));
    check_ldlAccount_unique.setText("检查银行卡号是否唯一");
    check_ldlAccount_unique.addActionListener(new
        MainFrame_check_ldlAccount_unique_actionAdapter(this));

    check_ldlIdcard_unique.addActionListener(new
        MainFrame_check_ldlIdcard_unique_actionAdapter(this));
    ldl_ok.setFont(new java.awt.Font("黑体", 0, 14));
    ldl_ok.setText("确定");
    ldl_ok.addActionListener(new MainFrame_ldl_ok_actionAdapter(this));
    ldl_reset.setFont(new java.awt.Font("黑体", 0, 14));
    ldl_reset.setText("重置");
    ldl_reset.addActionListener(new MainFrame_ldl_reset_actionAdapter(this));
    ldlAccountTxt.setFont(new java.awt.Font("黑体", 0, 14));
    ldlCustomerIDCardTxt.setFont(new java.awt.Font("黑体", 0, 14));
    ldlCustomerNameTxt.setFont(new java.awt.Font("黑体", 0, 14));
    ldlAmountTxt.setFont(new java.awt.Font("黑体", 0, 14));
    ldlAuthNumTxt.setFont(new java.awt.Font("黑体", 0, 14));
    ldlDealDateTxt.setFont(new java.awt.Font("黑体", 0, 14));
    fvoIDCardLbl.setText("身份证号");
    fvoIDCardLbl.setFont(new java.awt.Font("黑体", 0, 14));
    fvoCustomerNameTxt.setFont(new java.awt.Font("黑体", 0, 14));

    fvo_ok.setText("确定");
    fvo_ok.addActionListener(new MainFrame_fvo_ok_actionAdapter(this));
    fvo_ok.setFont(new java.awt.Font("黑体", 0, 14));
    fvoNameLbl.setText("姓名");
    fvoNameLbl.setFont(new java.awt.Font("黑体", 0, 14));
    fvoAccountLbl.setText("银行卡号");
    fvoAccountLbl.setFont(new java.awt.Font("黑体", 0, 14));
    fvoCustomerIDCardTxt.setFont(new java.awt.Font("黑体", 0, 14));
    fvoDealDateLbl.setText("刷卡交易日期");
    fvoDealDateLbl.setFont(new java.awt.Font("黑体", 0, 14));
    fvoTitle.setText("满500送100登记");
    fvoTitle.setFont(new java.awt.Font("黑体", 0, 20));
    fvoAuthNumTxt.setFont(new java.awt.Font("黑体", 0, 14));
    check_fvodcard_unique.setText("检查身份证号是否唯一");
    check_fvodcard_unique.addActionListener(new
        MainFrame_check_fvodcard_unique_actionAdapter(this));
    check_fvodcard_unique.setFont(new java.awt.Font("黑体", 0, 14));
    fvoAmountTxt.setFont(new java.awt.Font("黑体", 0, 14));
    fvoAccountTxt.setFont(new java.awt.Font("黑体", 0, 14));

    fvo_reset.setText("重置");
    fvo_reset.addActionListener(new MainFrame_fvo_reset_actionAdapter(this));
    fvo_reset.setFont(new java.awt.Font("黑体", 0, 14));
    fvoPanel.setLayout(gridBagLayout2);
    check_fvoAccount_unique.setFont(new java.awt.Font("黑体", 0, 14));
    check_fvoAccount_unique.setText("检查银行卡号是否唯一");
    check_fvoAccount_unique.addActionListener(new
        MainFrame_check_fvoAccount_unique_actionAdapter(this));

    fvoAmountLbl.setFont(new java.awt.Font("黑体", 0, 14));
    fvoAmountLbl.setForeground(Color.blue);
    fvoAmountLbl.setText("满500的刷卡单金额");
    fvoDealDateTxt.setText(todayString);
    fvoDealDateTxt.setFont(new java.awt.Font("黑体", 0, 14));
    fvoAuthNumLbl.setFont(new java.awt.Font("黑体", 0, 14));
    fvoAuthNumLbl.setText("刷卡单授权号");
    yzq_ok.setFont(new java.awt.Font("黑体", 0, 14));
    yzq_ok.addActionListener(new MainFrame_yzq_ok_actionAdapter(this));
    yzq_ok.setText("确定");
    yzqTitle.setFont(new java.awt.Font("黑体", 0, 20));
    yzqTitle.setPreferredSize(new Dimension(180, 24));
    yzqTitle.setRequestFocusEnabled(true);
    yzqTitle.setText("一折起商品抢购登记");
    check_yzqdcard_unique.setFont(new java.awt.Font("黑体", 0, 14));
    check_yzqdcard_unique.addActionListener(new
        MainFrame_check_yzqdcard_unique_actionAdapter(this));
    check_yzqdcard_unique.setText("检查身份证号是否唯一");
    yzqDealDateLbl.setFont(new java.awt.Font("黑体", 0, 14));
    yzqDealDateLbl.setText("刷卡交易日期");
    yzqAmountTxt.setFont(new java.awt.Font("黑体", 0, 14));
    yzqIDCardLbl.setFont(new java.awt.Font("黑体", 0, 14));
    yzqIDCardLbl.setText("身份证号");
    yzqAuthNumTxt.setFont(new java.awt.Font("黑体", 0, 14));
    yzq_reset.setFont(new java.awt.Font("黑体", 0, 14));
    yzq_reset.addActionListener(new MainFrame_yzq_reset_actionAdapter(this));
    yzq_reset.setText("重置");
    yzq_reset.addActionListener(new MainFrame_yzq_reset_actionAdapter(this));
    yzqAmountLbl.setText("满500的刷卡单金额");
    yzqAmountLbl.setForeground(Color.blue);
    yzqAmountLbl.setFont(new java.awt.Font("黑体", 0, 14));
    yzqNameLbl.setFont(new java.awt.Font("黑体", 0, 14));
    yzqNameLbl.setText("姓名");
    yzqAccountTxt.setFont(new java.awt.Font("黑体", 0, 14));
    yzqCustomerNameTxt.setFont(new java.awt.Font("黑体", 0, 14));
    yzqPanel.setLayout(gridBagLayout3);
    check_yzqAccount_unique.setFont(new java.awt.Font("黑体", 0, 14));
    check_yzqAccount_unique.setText("检查银行卡号是否唯一");
    check_yzqAccount_unique.addActionListener(new
        MainFrame_check_yzqAccount_unique_actionAdapter(this));
    yzqCustomerIDCardTxt.setFont(new java.awt.Font("黑体", 0, 14));
    yzqDealDateTxt.setText(todayString);
    yzqDealDateTxt.setFont(new java.awt.Font("黑体", 0, 14));
    yzqAccountLbl.setText("银行卡号");
    yzqAccountLbl.setFont(new java.awt.Font("黑体", 0, 14));
    yzqAuthNumLbl.setFont(new java.awt.Font("黑体", 0, 14));
    yzqAuthNumLbl.setText("刷卡单授权号");
    yzqProductNameLbl.setText("商品名称");
    yzqProductNameLbl.setFont(new java.awt.Font("黑体", 0, 14));

    yzqProductNameCmb.setActionCommand("comboBoxChanged");
    yzqProductNameCmb.setFont(new java.awt.Font("黑体", 0, 14));
    this.setProductNameList();

    contentPane.add(tabbedPane, BorderLayout.CENTER);
    tabbedPane.add(ldlPanel, "来店礼");

    //lables
    ldlPanel.add(ldlNameLbl, new GridBagConstraints(0, 2, 2, 1, 0.0, 0.0
        , GridBagConstraints.CENTER, GridBagConstraints.NONE,
        new Insets(5, 30, 5, 10), 0, 0));
    ldlPanel.add(ldlIDCardLbl, new GridBagConstraints(0, 3, 2, 1, 0.0, 0.0
        , GridBagConstraints.CENTER, GridBagConstraints.NONE,
        new Insets(5, 30, 5, 10), 0, 0));
    ldlPanel.add(ldlAccountLbl, new GridBagConstraints(0, 4, 2, 2, 0.0, 0.0
        , GridBagConstraints.CENTER, GridBagConstraints.NONE,
        new Insets(5, 30, 5, 10), 0, 0));
    ldlPanel.add(ldlAmountLbl, new GridBagConstraints(0, 6, 2, 2, 0.0, 0.0
        , GridBagConstraints.CENTER, GridBagConstraints.NONE,
        new Insets(5, 30, 5, 10), 0, 0));
    ldlPanel.add(ldlAuthNumLbl, new GridBagConstraints(0, 8, 2, 2, 0.0, 0.0
        , GridBagConstraints.CENTER, GridBagConstraints.NONE,
        new Insets(5, 30, 5, 10), 0, 0));
    ldlPanel.add(ldlDealDateLbl, new GridBagConstraints(0, 10, 2, 2, 0.0, 0.0
        , GridBagConstraints.CENTER, GridBagConstraints.NONE,
        new Insets(5, 30, 5, 10), 0, 0));

    //txtfields

    ldlPanel.add(ldlCustomerNameTxt,
                 new GridBagConstraints(2, 2, 2, 1, 1.0, 0.0
                                        , GridBagConstraints.CENTER,
                                        GridBagConstraints.BOTH,
                                        new Insets(5, 10, 5, 10), 162, 4));

    ldlPanel.add(ldlCustomerIDCardTxt,
                 new GridBagConstraints(2, 3, 2, 1, 1.0, 0.0
                                        , GridBagConstraints.CENTER,
                                        GridBagConstraints.BOTH,
                                        new Insets(5, 10, 5, 10), 162, 4));

    ldlPanel.add(ldlAccountTxt, new GridBagConstraints(2, 4, 2, 1, 1.0, 0.0
        , GridBagConstraints.CENTER, GridBagConstraints.BOTH,
        new Insets(5, 10, 5, 10), 162, 4));

    ldlPanel.add(ldlAmountTxt, new GridBagConstraints(2, 6, 2, 1, 1.0, 0.0
        , GridBagConstraints.CENTER, GridBagConstraints.BOTH,
        new Insets(5, 10, 5, 10), 162, 4));

    ldlPanel.add(ldlAuthNumTxt, new GridBagConstraints(2, 8, 2, 1, 1.0, 0.0
        , GridBagConstraints.CENTER, GridBagConstraints.BOTH,
        new Insets(5, 10, 5, 10), 162, 4));

    ldlPanel.add(ldlDealDateTxt, new GridBagConstraints(2, 10, 2, 1, 1.0, 0.0
        , GridBagConstraints.CENTER, GridBagConstraints.BOTH,
        new Insets(5, 10, 5, 10), 162, 4));

    //buttons
    ldlPanel.add(check_ldlIdcard_unique,
                 new GridBagConstraints(6, 3, 1, 1, 0.0, 0.0
                                        , GridBagConstraints.CENTER,
                                        GridBagConstraints.NONE,
                                        new Insets(5, 30, 5, 10), 0, 0));
    ldlPanel.add(check_ldlAccount_unique,
                 new GridBagConstraints(6, 4, 1, 2, 0.0, 0.0

⌨️ 快捷键说明

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