java_ATM机银行存取款系统的设计与实现本科毕业论文

商丘师范学院2012届本科毕业论文(设计)

import dao.Yhdao; import vo.Lsvo; import vo.Yhvo;

public class Zcact extends JFrame implements ActionListener{ private static final long serialVersionUID = 5527318937044475231L; JFrame f=new JFrame(\账户注册\); JLabel l1 = new JLabel(\户名\); JTextField t1 = new JTextField(10); JLabel l2 = new JLabel(\密码\); JPasswordField p1 = new JPasswordField(); JLabel l3 = new JLabel(\确认密码\); JPasswordField p2 = new JPasswordField(); JButton JB1 = new JButton(\注册\); public void ff (){ f.add(l1);//户名 l1.setBounds(140,50,40,30); f.add(l2); l2.setBounds(140,100,40,30); f.add(t1); t1.setBounds(190,50,160,30); f.add(p1); p1.setBounds(190,100,160,30); f.add(l3); l3.setBounds(120,150,60,30); f.add(p2); p2.setBounds(190,150,160,30); f.add(JB1); JB1.addActionListener(this); JB1.setBounds(200,220,60,30); f.setBounds(400,150,480,350); f.setLayout(null); addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e){ System.exit(0); } }); f.setVisible(true); }

//public static void main(String[]agrs){ //Zcact d=new Zcact(); //d.ff(); //} @Override

25

商丘师范学院2012届本科毕业论文(设计) }

public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub String s1=t1.getText(); String s2=String.valueOf(p1.getPassword()); String s3=String.valueOf(p2.getPassword()); System.out.println(s2 ); if(!s2.equals(s3)){JOptionPane.showMessageDialog(null,\密码输入不一致\);return;} else{JOptionPane.showMessageDialog(null,\注册成功\);} Yhvo yvo=new Yhvo(); Lsvo lvo=new Lsvo(); yvo.setHuming(s1); yvo.setMima(s2); yvo.setYue(10000); lvo.setHuming(s1); lvo.setCaozuo(\注册账号获得10000\); lvo.setYue(10000); yvo.setShijian(new Date()); try { Yhdao.ff2(yvo, 1); Lsdao.ff2(lvo, 1); } catch (ClassNotFoundException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } }

package action; //用户主界面

import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JButton; import javax.swing.JFrame; //用户个人界面

public class Xzact extends JFrame implements ActionListener { private static final long serialVersionUID = 6259280831667305554L; JFrame f=new JFrame(\用户界面\); JButton JB1 = new JButton(\存款\);

26

商丘师范学院2012届本科毕业论文(设计) }

JButton JB2 = new JButton(\取款\); JButton JB3 = new JButton(\转账\);

JButton JB4 = new JButton(\查询历史记录\); String hm=null; String mm=null;

public void ff (String hm,String mm){ this.hm=hm; this.mm=mm; f.add(JB1);//户名 JB1.setBounds(100,50,120,30); f.add(JB2);//户名 JB2.setBounds(250,50,120,30); f.add(JB3);//户名 JB3.setBounds(100,100,120,30); f.add(JB4);//户名 JB4.setBounds(250,100,120,30); JB1.addActionListener(this); JB2.addActionListener(this); JB3.addActionListener(this); JB4.addActionListener(this); f.setBounds(400,150,480,350); f.setLayout(null); addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e){ System.exit(0); } }); f.setVisible(true); }

//public static void main(String[]agrs){ //Xzact d=new Xzact(); //d.ff(); //}

@Override

public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub //System.out.println(\ if (e.getSource()==JB1){Ckact c=new Ckact();c.ff(hm,mm);} else if(e.getSource()==JB2){Qkact c=new Qkact();c.ff(hm,mm);} else if(e.getSource()==JB3){Zzact z=new Zzact();z.ff(hm);} else if(e.getSource()==JB4){Lsact l=new Lsact();l.ff(hm);} }

27

商丘师范学院2012届本科毕业论文(设计)

package action;

import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.sql.SQLException; import java.util.List;

import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import dao.Lsdao; import dao.Yhdao; import vo.Lsvo; import vo.Yhvo;

//用户存款小窗口

public class Ckact extends JFrame implements ActionListener{ private static final long serialVersionUID = 3515118621002743025L; JFrame f=new JFrame(\用户存款界面\); JLabel l1 = new JLabel(\存款金额\); JTextField t1 = new JTextField(10); JButton JB1 = new JButton(\存款\); String hm;String mm;

public void ff(String hm,String mm){ this.hm=hm; this.mm=mm; f.add(l1); l1.setBounds(90,70,80,30); f.add(t1); t1.setBounds(160,70,100,30); f.add(JB1); JB1.setBounds(140,130,80,30); JB1.addActionListener(this); f.setBounds(400,150,385,250); f.setLayout(null); addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e){ System.exit(0); } }); f.setVisible(true);

28

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4