java项目 ATM银行系统 源代码(32页).doc
《java项目 ATM银行系统 源代码(32页).doc》由会员分享,可在线阅读,更多相关《java项目 ATM银行系统 源代码(32页).doc(32页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、-java项目 ATM银行系统 源代码-第 32 页/初始密码为123456import java.awt.*;import java.awt.event.*;import javax.swing.*;public class MyATM extends JFrame implements ActionListenerJPanel panelfirst,panelmain,panel3,panel4,panel5,panel6,panel7,panelchangepwd,panelchangepwded,panelsave,panelsaved,panelremain,paneltrans,p
2、aneltransed,panelmobile,panelmobiled,panelconsult;JButton btn0,btn1,btn2,btn3,btn4,btn5,btn6,btn7,btn8,btn9,btn10,btnsure,btnback,btnok,btncard,btngetcard,btnincard;JButton btn00,btn01,btn02,btn03,btn04,btn05,btn06,btn07,btn08,btn09,btn010,btnback1,btnremain,btnremain1,btnremain2;JButton btn000,btn0
3、01,btn002,btn003,btn004,btn005,btn006,btn007,btn008,btn009,btn100,btn200,btn300,btn1000,btn500,btnsure1,btnback2,btn0010,btnquok1,btnquok2,btnquok3,btnquok4;JButton btnpwd,btnpwd1,btnpwd2,btnpwd3,btnpwd4,btn11,btn12,btn13,btn14,btn15,btn16,btn17,btn18,btn19,btn20,btnsave,btnsave1,btnsave2,btnsaved,b
4、tnsaved1,btnsaved2,btnsaved3;JButton btntra,btntra1,btntra2,btntraed,btntraed1,btn21,btn22,btn23,btn24,btn25,btn26,btn27,btn28,btn29,btn30,btncon,btncon1;JButton btnmo,btnmo1,btnmo2,btnmo30,btnmo50,btnmo100,btnmo200,btnmo500,btnmo10,btnmo11,btnmo12,btnmo13,btnmo14,btnmo15,btnmo16,btnmo17,btnmo18,btn
5、mo19,btnmoed,btnmoed1;JTextField txt2,txttrans,txttrans1,txttrans2,txtmo,txtmo1;JLabel lbljixu,lblpwd,lblwrong,lblqukuan,lblquok1,lblquok2,lblpwd1,lblpwd2,lblpwd3,lblpwd4,lblsave,lblsave1,lblsaved,lblremain,lblremain1,lbltra,lbltra1,lbltra2,lbltraed,lbltraed1;JLabel lblwel,lblwel1,lblmo,lblmo1,lblmo
6、2,lblmo3,lblmoed,lblmoed1,lblcon,lblcon1;JPasswordField txt1,txtpwd,txtpwd1;Container container;CardLayout Layout;int money,savemoney,mobilemoney=0;double lastmoney,trainsmoney;String userpwd,cardnum,trains,username;boolean flag=true,flag1=false,flag2=false,flag3=true,flag4=false,flag5=false;/构造方法pu
7、blic MyATM()super(罗灿银行);this.setSize(435,350);this.setLocation(500, 250);this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE ); /设置不可改变窗口大小this.setResizable(false); /设置程序小图标this.setIconImage(this.getToolkit().getImage(imageshaizei.jpg);/布局public void setLayout()/用卡片布局Layout=new CardLayout();container
8、=getContentPane();container.setLayout(Layout);/添加第一张卡片panelfirst=new JPanel(null);/设置卡片的背景颜色panelfirst.setBackground(new Color(119,119,253);lbljixu=new JLabel(请放入磁卡,然后继续操作);/设置卡片在Panel中的位置lbljixu.setBounds(140,90,350,30);/为第一张卡片添加一个Labelpanelfirst.add(lbljixu);/为第一张卡片添加一个按钮btncard=new JButton(继续);bt
9、ncard.setBounds(310,180,80,30);/为按钮注册事件监听器btncard.addActionListener(this);/开始时设置按钮不可按btncard.setEnabled(false);panelfirst.add(btncard);/为第一张卡片添加一个按钮btngetcard=new JButton(取卡);btngetcard.setEnabled(false);btngetcard.setBounds(310,220,80,30);btngetcard.addActionListener(this);panelfirst.add(btngetcard
10、);/为第一张卡片添加一个按钮btnincard=new JButton(插卡);btnincard.setBounds(40,220,80,30);btnincard.addActionListener(this);panelfirst.add(btnincard);container.add(panelfirst,first);/添加登录输入密码卡片panelmain=new JPanel(null);panelmain.setBackground(new Color(119,119,253);lblpwd=new JLabel(请输入您的银行卡密码:);panelmain.add(lbl
11、pwd);lblpwd.setBounds(150, 20, 150, 30);/设置文本框为密码型txt1=new JPasswordField(12);/文本框不可选中txt1.enable(false);panelmain.add(txt1);/文本框的输入内容用*显示txt1.setEchoChar(*);txt1.setBounds(115,50,200,30);/添加选择按钮btnsure=new JButton(确定);btnsure.addActionListener(this);panelmain.add(btnsure);btnsure.setBounds(70,160,8
12、0,30);/添加重输按钮btn010=new JButton(重输);btn010.addActionListener(this);panelmain.add(btn010);btn010.setBounds(175,160,80,30);btnback=new JButton(退出);btnback.addActionListener(this);panelmain.add(btnback);btnback.setBounds(280,160,80,30);lblwrong=new JLabel(请注意保护好您的密码!);panelmain.add(lblwrong);lblwrong.s
13、etBounds(150,90,200,30);/添加输入按钮btn01=new JButton(1);btn01.addActionListener(this);panelmain.add(btn01);btn01.setBounds(45,210,60,30);btn02=new JButton(2);btn02.addActionListener(this);panelmain.add(btn02);btn02.setBounds(115,210,60,30);btn03=new JButton(3);btn03.addActionListener(this);panelmain.add
14、(btn03);btn03.setBounds(185,210,60,30);btn04=new JButton(4);btn04.addActionListener(this);panelmain.add(btn04);btn04.setBounds(255,210,60,30);btn05=new JButton(5);btn05.addActionListener(this);panelmain.add(btn05);btn05.setBounds(325,210,60,30);btn06=new JButton(6);btn06.addActionListener(this);pane
15、lmain.add(btn06);btn06.setBounds(45,260,60,30);btn07=new JButton(7);btn07.addActionListener(this);panelmain.add(btn07);btn07.setBounds(115,260,60,30);container.add(panelmain,main);btn08=new JButton(8);btn08.addActionListener(this);panelmain.add(btn08);btn08.setBounds(185,260,60,30);btn09=new JButton
16、(9);btn09.addActionListener(this);panelmain.add(btn09);btn09.setBounds(255,260,60,30);btn00=new JButton(0);btn00.addActionListener(this);panelmain.add(btn00);btn00.setBounds(325,260,60,30);/添加主界面卡片panel3=new JPanel(null);panel3.setBackground(new Color(119,119,253);lblwel=new JLabel(username+,欢迎使用罗灿银
17、行ATM系统);lblwel.setBounds(20,15,350,30);panel3.add(lblwel);lblwel1=new JLabel(请选择您需要的交易类型);lblwel1.setBounds(220,55,350,30);panel3.add(lblwel1);btn3=new JButton(取款服务);btn3.addActionListener(this);btn3.setBounds(20,90,100,30);panel3.add(btn3);btn4=new JButton(修改密码);btn4.addActionListener(this);btn4.se
18、tBounds(20,150,100,30);panel3.add(btn4);btn5=new JButton(存款服务);btn5.addActionListener(this);btn5.setBounds(20,210,100,30);panel3.add(btn5);btn6=new JButton(查询余额);btn6.addActionListener(this);btn6.setBounds(20,270,100,30);panel3.add(btn6);btn7=new JButton(转账服务);btn7.addActionListener(this);btn7.setBo
19、unds(300,90,100,30);panel3.add(btn7);btn8=new JButton(通信交费);btn8.addActionListener(this);btn8.setBounds(300,150,100,30);panel3.add(btn8);btn9=new JButton(咨询服务);btn9.addActionListener(this);btn9.setBounds(300,210,100,30);panel3.add(btn9);btn10=new JButton(退出操作);btn10.addActionListener(this);btn10.set
20、Bounds(300,270,100,30);panel3.add(btn10);container.add(panel3,three);/添加取款页面卡片panel4=new JPanel(null);panel4.setBackground(new Color(119,119,253);lblqukuan=new JLabel(请输入您的取款数:);panel4.add(lblqukuan);lblqukuan.setBounds(115, 20, 150, 30);lblqukuan=new JLabel(提示:只能是100元或100元的整数倍。);panel4.add(lblqukua
21、n);lblqukuan.setBounds(115, 50, 300, 30);txt2=new JTextField(12);txt2.enable(false);panel4.add(txt2);txt2.setBounds(115,90,200,30);btn100=new JButton(100);panel4.add(btn100);btn100.addActionListener(this);btn100.setBounds(45,190,60,30);btn200=new JButton(200);panel4.add(btn200);btn200.addActionListe
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- java项目 ATM银行系统 源代码32页 java 项目 ATM 银行 系统 源代码 32
限制150内