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