s12panel.java~1~

来自「银行信用评估系统」· JAVA~1~ 代码 · 共 601 行 · 第 1/2 页

JAVA~1~
601
字号
package management;import java.awt.*;import javax.swing.*;import java.sql.*;import com.borland.dbswing.*;import javax.swing.border.*;import java.awt.event.*;//import java.util.*;import java.text.SimpleDateFormat;import java.text.DateFormat;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class s12Panel extends JPanel {  JLabel jLabel1 = new JLabel();  JLabel jLabel01 = new JLabel();  JLabel jLabel3 = new JLabel();  JLabel jLabel4 = new JLabel();  JLabel jLabel5 = new JLabel();  JComboBox jComboBox1 = new JComboBox();  JLabel jLabel6 = new JLabel();  JTextField jTextField1 = new JTextField();  JLabel jLabel7 = new JLabel();  JLabel jLabel02 = new JLabel();  JLabel jLabel9 = new JLabel();  JButton jButton1 = new JButton();  JButton jButton2 = new JButton();  JButton jButton3 = new JButton();  JLabel jLabel10 = new JLabel();  JLabel jLabel03 = new JLabel();  JLabel jLabel04 = new JLabel();  JLabel jLabel14 = new JLabel();  JButton jButton4 = new JButton();  JButton jButton5 = new JButton();  JPasswordField jPasswordField1 = new JPasswordField();  PreparedStatement s12stmt1;  PreparedStatement s12stmt2;  Connection s12con;  String s12sql,s12sql2;  ResultSet s12rs,s12rs2;  private double zvalue,zmoney,dmoney;  private byte zvariety;  private boolean islie=false;  private String uid,uname,ucard,cid,cpwd,cGrade,zid,zname,zdate,zprice,zkind;  JTextField jTextField2 = new JTextField();  JLabel jLabel2 = new JLabel();  JTextField jTextField3 = new JTextField();  JLabel jLabel8 = new JLabel();  JTextField jTextField4 = new JTextField();  JLabel jLabel11 = new JLabel();  JTextField jTextField5 = new JTextField();  public s12Panel() {    try {      jbInit();    }    catch(Exception ex) {      ex.printStackTrace();    }  }  void jbInit() throws Exception { //   border1 = BorderFactory.createLineBorder(SystemColor.controlText,1);    jLabel1.setBackground(Color.pink);    jLabel1.setFont(new java.awt.Font("Dialog", 1, 30));    jLabel1.setForeground(Color.blue);    jLabel1.setAlignmentX((float) 0.0);    jLabel1.setDebugGraphicsOptions(0);    jLabel1.setOpaque(false);    jLabel1.setRequestFocusEnabled(true);    jLabel1.setHorizontalAlignment(SwingConstants.CENTER);    jLabel1.setText("抵/质押及时调整子系统");    jLabel1.setBounds(new Rectangle(1, 0, 489, 61));    this.setLayout(null);    this.setBackground(SystemColor.control);    this.setBorder(null);    this.setDebugGraphicsOptions(0);    this.setOpaque(true);    this.setRequestFocusEnabled(true);    this.setVerifyInputWhenFocusTarget(true);    jLabel01.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel01.setBorder(BorderFactory.createEtchedBorder());    jLabel01.setDebugGraphicsOptions(0);    jLabel01.setHorizontalAlignment(SwingConstants.CENTER);    jLabel01.setText("");    jLabel01.setBounds(new Rectangle(104, 165, 126, 27));    jLabel3.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);    jLabel3.setText("信用卡号");    jLabel3.setBounds(new Rectangle(26, 66, 66, 26));    jLabel4.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel4.setText("抵/质押物名称");    jLabel4.setBounds(new Rectangle(129, 345, 95, 27));    jLabel5.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel5.setHorizontalAlignment(SwingConstants.RIGHT);    jLabel5.setText("调整方式");    jLabel5.setBounds(new Rectangle(155, 305, 69, 30));    jComboBox1.addItem("质押");    jComboBox1.addItem("抵押");    jComboBox1.setFont(new java.awt.Font("Dialog", 0, 15));    jComboBox1.setRequestFocusEnabled(true);    jComboBox1.setToolTipText("");    jComboBox1.setSelectedIndex(0);    jComboBox1.setBounds(new Rectangle(235, 305, 117, 31));    jLabel6.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel6.setHorizontalAlignment(SwingConstants.RIGHT);    jLabel6.setText("用户号");    jLabel6.setBounds(new Rectangle(47, 164, 56, 30));    jTextField1.setBorder(BorderFactory.createLoweredBevelBorder());    jTextField1.setToolTipText("");    jTextField1.setText("");    jTextField1.setBounds(new Rectangle(104, 65, 131, 26));    jTextField1.addActionListener(new s12Panel_jTextField1_actionAdapter(this));    jLabel7.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel7.setHorizontalAlignment(SwingConstants.RIGHT);    jLabel7.setText("用户名");    jLabel7.setBounds(new Rectangle(251, 165, 55, 27));    jLabel02.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel02.setBorder(BorderFactory.createEtchedBorder());    jLabel02.setHorizontalAlignment(SwingConstants.CENTER);    jLabel02.setText("");    jLabel02.setBounds(new Rectangle(317, 163, 86, 29));    jLabel9.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel9.setHorizontalAlignment(SwingConstants.RIGHT);    jLabel9.setHorizontalTextPosition(SwingConstants.LEADING);    jLabel9.setText("密码");    jLabel9.setBounds(new Rectangle(242, 64, 54, 29));    jButton1.setBounds(new Rectangle(141, 108, 82, 36));    jButton1.setFont(new java.awt.Font("Dialog", 0, 15));    jButton1.setText("确定");    jButton1.addActionListener(new s12Panel_jButton1_actionAdapter(this));    jButton2.setBounds(new Rectangle(291, 108, 78, 36));    jButton2.setFont(new java.awt.Font("Dialog", 0, 15));    jButton2.setText("重装");    jButton2.addActionListener(new s12Panel_jButton2_actionAdapter(this));    jButton3.setBounds(new Rectangle(349, 490, 76, 40));    jButton3.setFont(new java.awt.Font("Dialog", 0, 15));    jButton3.setText("返回");    jButton3.addActionListener(new s12Panel_jButton3_actionAdapter(this));    jLabel10.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel10.setHorizontalAlignment(SwingConstants.RIGHT);    jLabel10.setText("身份证号");    jLabel10.setBounds(new Rectangle(36, 208, 68, 29));    jLabel03.setBorder(BorderFactory.createEtchedBorder());    jLabel03.setHorizontalAlignment(SwingConstants.CENTER);    jLabel03.setText("");    jLabel03.setBounds(new Rectangle(103, 208, 124, 28));    jLabel04.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel04.setBorder(BorderFactory.createEtchedBorder());    jLabel04.setHorizontalAlignment(SwingConstants.CENTER);    jLabel04.setText("");    jLabel04.setBounds(new Rectangle(316, 206, 87, 30));    jLabel14.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel14.setText("信用等级");    jLabel14.setBounds(new Rectangle(244, 210, 62, 26));    jButton4.setBackground(SystemColor.menu);    jButton4.setBounds(new Rectangle(92, 492, 79, 39));    jButton4.setFont(new java.awt.Font("Dialog", 0, 15));    jButton4.setText("调整");    jButton4.addActionListener(new s12Panel_jButton4_actionAdapter(this));    jButton5.setBounds(new Rectangle(225, 491, 72, 40));    jButton5.setFont(new java.awt.Font("Dialog", 0, 15));    jButton5.setText("取消");    jButton5.addActionListener(new s12Panel_jButton5_actionAdapter(this));    jPasswordField1.setText("");    jPasswordField1.setBounds(new Rectangle(306, 63, 135, 29));    jPasswordField1.addActionListener(new s12Panel_jPasswordField1_actionAdapter(this));    jTextField2.setFont(new java.awt.Font("Dialog", 0, 15));    jTextField2.setText("");    jTextField2.setBounds(new Rectangle(235, 345, 117, 27));    jTextField2.addActionListener(new s12Panel_jTextField2_actionAdapter(this));    jLabel2.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);    jLabel2.setText("抵/质押物金额");    jLabel2.setBounds(new Rectangle(116, 384, 107, 31));    jTextField3.setFont(new java.awt.Font("Dialog", 0, 15));    jTextField3.setText("");    jTextField3.setBounds(new Rectangle(235, 384, 117, 29));    jTextField3.addActionListener(new s12Panel_jTextField3_actionAdapter(this));    jLabel8.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel8.setHorizontalAlignment(SwingConstants.RIGHT);    jLabel8.setText("抵/质押日期");    jLabel8.setBounds(new Rectangle(127, 427, 96, 31));    jTextField4.setBackground(Color.white);    jTextField4.setFont(new java.awt.Font("Dialog", 0, 15));    jTextField4.setBounds(new Rectangle(235, 426, 117, 31));    jTextField4.addActionListener(new s12Panel_jTextField4_actionAdapter(this));    jLabel11.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel11.setHorizontalAlignment(SwingConstants.RIGHT);    jLabel11.setText("抵/质押物编号");    jLabel11.setBounds(new Rectangle(124, 262, 103, 34));    jTextField5.setText("");    jTextField5.setBounds(new Rectangle(235, 263, 116, 31));    jTextField5.addActionListener(new s12Panel_jTextField5_actionAdapter(this));    this.add(jLabel1, null);    this.add(jTextField1, null);    this.add(jLabel3, null);    this.add(jPasswordField1, null);    this.add(jLabel9, null);    this.add(jLabel01, null);    this.add(jLabel6, null);    this.add(jLabel10, null);    this.add(jLabel02, null);    this.add(jLabel7, null);    this.add(jLabel04, null);    this.add(jLabel14, null);    this.add(jTextField2, null);    this.add(jTextField3, null);    this.add(jTextField4, null);    this.add(jLabel8, null);    this.add(jLabel2, null);    this.add(jLabel4, null);    this.add(jButton1, null);    this.add(jButton2, null);    this.add(jButton3, null);    this.add(jButton4, null);    this.add(jLabel03, null);    this.add(jButton5, null);    this.add(jTextField5, null);    this.add(jLabel11, null);    this.add(jComboBox1, null);    this.add(jLabel5, null);    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");  }  void countCGrade(double money){    if(money>=50000) cGrade="A";      else if(money>=40000) cGrade="B";      else if(money>=30000) cGrade="C";      else if(money>=20000) cGrade="D";      else if(money>=10000) cGrade="E";      else if(money>=5000)  cGrade="F";      else if(money>=2000)  cGrade="G";      else                  cGrade="H";  }  void setempty(){    jLabel01.setText(null);    jLabel02.setText(null);    jLabel03.setText(null);    jLabel04.setText(null);    jTextField2.setText(null);    jTextField3.setText(null);    jTextField4.setText(null);    jTextField5.setText(null);  }int getmoney(char ch){  switch(ch){    case 'A':   return 50000;    case 'B':   return 40000;    case 'C':   return 30000;    case 'D':   return 20000;    case 'E':   return 10000;    case 'F':   return 5000;    case 'G':   return 2000;    case 'H':   return 0 ;    default :  return -1;  }}  void jButton1_actionPerformed(ActionEvent e) {    try{      if(jTextField1.getText().length()==0){        JOptionPane.showMessageDialog(this,"信用卡号不能为空!","警告",JOptionPane.WARNING_MESSAGE);        // focus     jTextField1.se();        return;      }        else if(jPasswordField1.getPassword().length==0){          JOptionPane.showMessageDialog(this,"密码不能为空!","警告",JOptionPane.WARNING_MESSAGE);          //set focus          return;        }      cid=jTextField1.getText();      cpwd="";      for(int i=0;i<jPasswordField1.getPassword().length;i++)        cpwd+=jPasswordField1.getPassword()[i];      jTextField1.setText(null);      jPasswordField1.setText(null);      String url = "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=CCES";      String username= "sa";      String password= "";      s12con = DriverManager.getConnection(url,username,password);      s12sql="select UserId,CreditcardGrade from Creditcard where CreditcardId=? and CreditcardCode=?";      s12stmt1 = s12con.prepareStatement(s12sql);      s12stmt1.setString(1,cid);      s12stmt1.setString(2,cpwd);      s12rs=s12stmt1.executeQuery();      if(s12rs.next()){        uid=s12rs.getString(1);

⌨️ 快捷键说明

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