| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1762 人关注过本帖
标题:一个银行账户系统,如何用文件保存和使用文件中的用户名,密码进行登陆以及 ...
取消只看楼主 加入收藏
夙愿000000
Rank: 1
来 自:甘肃张掖
等 级:新手上路
帖 子:10
专家分:0
注 册:2016-4-10
结帖率:50%
收藏
 问题点数:0 回复次数:0 
一个银行账户系统,如何用文件保存和使用文件中的用户名,密码进行登陆以及转账,等操作
package home;
import java.awt.*;
import *;
import java.awt.event.*;
import java.util.Calendar;
import javax.swing.*;
@SuppressWarnings("serial")
public  class banksystem extends JFrame implements ActionListener{
    static banksystem frm=new banksystem();
    static banksystem frm1=new banksystem();
    static banksystem frm2=new banksystem();
    static banksystem frm3=new banksystem();
    static banksystem frm4=new banksystem();
    static banksystem bank0=new banksystem();
    static banksystem bank1=new banksystem();
    static banksystem bank2=new banksystem();
    static banksystem bank3=new banksystem();
    static banksystem bank4=new banksystem();
    static banksystem bank5=new banksystem();
    static banksystem bank6=new banksystem();
    static banksystem bank7=new banksystem();
    static banksystem bank00=new banksystem();
    static banksystem bank11=new banksystem();
    static banksystem bank22=new banksystem();
    static banksystem bank33=new banksystem();
    static banksystem bank44=new banksystem();
    static banksystem bank55=new banksystem();
    static banksystem bank66=new banksystem();
    static banksystem bank77=new banksystem();
   
    static JTextField name=new JTextField();
    static JPasswordField text=new JPasswordField();
    static JTextField enrollname=new JTextField();
    static JTextField enrollpassword=new JTextField();
    static JLabel jb1=new JLabel();
    static JLabel jb2=new JLabel();
    static JLabel jb3=new JLabel();
    static JButton bt1=new JButton();
    static JButton bt2=new JButton();
    static JButton bt3=new JButton();
   
    static JLabel jlb1=new JLabel("登陆成功!请进行相应的操作!");
    static JLabel jlb2=new JLabel("成功退出!欢迎下次使用!!!!!");
    static JButton[] bt={new JButton("存    款"),new JButton("取    款"),new JButton("转   账"),new JButton("余额查询"),new JButton("修改密码"),new JButton("账单打印"),new JButton("存取款清单"),new JButton("退    出")};
   
    static JButton exitbt1=new JButton("退出");
   
    static JButton enroll=new JButton("确认注册");
    static JButton backland=new JButton("返回登陆界面");
   
    static JLabel enrollyes=new JLabel("注册成功!");
    static JButton backpane=new JButton("返回登陆界面");
    static JButton exit=new JButton("退出系统");
   
    static JLabel setcash=new JLabel("请输入存款金额:");
    static JTextField setmoney=new JTextField();
    static JButton yes=new JButton("确认存款");
    static JButton backmajorpane=new JButton("返回主界面");
    static JLabel setyes=new JLabel("存款成功!!!");
   
    static JLabel getcash=new JLabel("请输入取款金额:");
    static JTextField getmoney=new JTextField();
    static JButton yes1=new JButton("确认取款");
    static JLabel getyes=new JLabel();
   
    static JLabel transmoney=new JLabel("该转账金额:");
    static JLabel user=new JLabel("转账人姓名:");
    static JLabel usercard=new JLabel("转账人卡号:");
    static JTextField transjb1=new JTextField();
    static JButton transbt1=new JButton("确认转账");
    static JTextField transjb2=new JTextField();
    static JTextField transjb3=new JTextField();
    static JLabel transyes1=new JLabel();
    static JLabel transyes2=new JLabel();
    static JLabel transyes3=new JLabel();
   
    static JLabel nowmoney= new JLabel("当前账户余额为:");
    static JTextField moneytext1=new JTextField();
   
    static JPasswordField password1=new JPasswordField();
    static JPasswordField password2=new JPasswordField();
    static JPasswordField password3=new JPasswordField();
    static JLabel password4=new JLabel("原 密 码:");
    static JLabel password5=new JLabel("当前密码:");
    static JLabel password6=new JLabel("密码确认:");
    static JButton passwordchange=new JButton("确认修改");
    static JLabel password7=new JLabel("       修改密码成功!!!");
    static JLabel password8=new JLabel("密码已修改,需要您重新登陆!!!");
    static JLabel password9=new JLabel();
    static JLabel password10=new JLabel();
   
    static JLabel information1=new JLabel("姓    名:");
    static JLabel information2=new JLabel("金    额:");
    static JLabel information3=new JLabel("属    性:");
    static JLabel information4=new JLabel("转账方式:");
    static JLabel information5=new JLabel("日    期:");
    static JLabel information6=new JLabel("时    间:");
    static JLabel information7=new JLabel("流 水号:");
    static JLabel information8=new JLabel("备    注:");
    static JLabel information9=new JLabel();
    static JLabel information10=new JLabel();
    static JLabel information11=new JLabel();
    static JLabel information12=new JLabel();
    static JLabel information13=new JLabel();
    static JLabel information14=new JLabel();
    static JLabel information15=new JLabel();
    static JLabel information16=new JLabel();
    static JLabel information17=new JLabel();
    static JLabel information18=new JLabel();
    Calendar c=Calendar.getInstance();
    long  i=(long)(Math.random()*(100000000-999999999+1));
    long b=Math.abs(i);
    static JButton informationbt1=new JButton("关闭");
   
    static JTextArea account=new JTextArea();
    static JLabel accountjb1=new JLabel("近期的存取款清单");
   
   
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        frm.setLayout(null);
        frm1.setLayout(null);
        frm2.setLayout(null);
        frm3.setLayout(null);
        frm4.setLayout(null);
        bank0.setLayout(null);
        bank1.setLayout(null);
        bank2.setLayout(null);
        bank3.setLayout(null);
        bank4.setLayout(null);
        bank5.setLayout(null);
        bank6.setLayout(null);
        bank7.setLayout(null);
        bank00.setLayout(null);
        bank11.setLayout(null);
        bank22.setLayout(null);
        bank33.setLayout(null);
        bank44.setLayout(null);
        bank55.setLayout(null);
        bank66.setLayout(null);
        bank77.setLayout(null);
        
        exit.setBounds(300, 300, 150, 40);
        exit.setFont(new java.awt.Font("楷体",1,20));
        exit.setForeground(Color.BLUE);
        frm.setBounds(350, 150, 400, 300);
        jb1.setText("用户名:");
        jb2.setText("密     码:");
        bt1.setText("登陆");
        bt2.setText("注册");
        bt3.setText("退出");
        bt1.setBounds(60, 180, 60, 20);
        bt2.setBounds(160, 180, 60, 20);
        bt3.setBounds(260, 180, 60, 20);
        jb1.setBounds(70, 70, 50, 20);
        jb2.setBounds(70, 120, 50, 20);
        frm.add(jb1);
        frm.add(jb2);
        frm.add(bt1);
        frm.add(bt2);
        frm.add(bt3);
        jb3.setText("欢迎使用银行系统,请登录!");
        jb3.setBounds(85, 30, 300, 20);
        jb3.setFont(new java.awt.Font("楷体",1,15));
        jb3.setForeground(Color.BLUE);
        name.setBounds(140, 70, 160, 20);
        text.setBounds(140, 120, 160, 20);
        frm.add(jb3);
        frm.add(name);
        frm.add(text);
        bt1.addActionListener(frm);
        bt2.addActionListener(frm);
        bt3.addActionListener(frm);
        frm.setVisible(true);
        frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        
        jlb1.setBounds(135, 30, 300, 20);
        jlb1.setFont(new java.awt.Font("楷体",1,20));
        jlb1.setForeground(Color.BLUE);
        bt[0].setBounds(0, 80, 120, 40);
        bt[0].setFont(new java.awt.Font("楷体",1,18));
        bt[1].setBounds(0, 150, 120, 40);
        bt[1].setFont(new java.awt.Font("楷体",1,18));
        bt[2].setBounds(0, 220, 120, 40);
        bt[2].setFont(new java.awt.Font("楷体",1,18));
        bt[7].setBounds(0, 290, 120, 40);
        bt[7].setFont(new java.awt.Font("楷体",1,18));
        bt[3].setBounds(400, 80, 200, 40);
        bt[3].setFont(new java.awt.Font("楷体",1,18));
        bt[4].setBounds(400, 150, 200, 40);
        bt[4].setFont(new java.awt.Font("楷体",1,18));
        bt[5].setBounds(400, 220, 200, 40);
        bt[5].setFont(new java.awt.Font("楷体",1,18));
        bt[6].setBounds(400, 290, 200, 40);
        bt[6].setFont(new java.awt.Font("楷体",1,18));
        frm1.add(jlb1);
        frm1.add(bt[0]);
        frm1.add(bt[1]);
        frm1.add(bt[2]);
        frm1.add(bt[3]);
        frm1.add(bt[4]);
        frm1.add(bt[5]);
        frm1.add(bt[6]);
        frm1.add(bt[7]);
        
        jlb2.setBounds(50,100, 300, 20);
        exitbt1.setBounds(150, 200, 80, 30);
        exitbt1.setFont(new java.awt.Font("楷体",1,20));
        exitbt1.setForeground(Color.GREEN);
        exitbt1.addActionListener(frm3);
        jlb2.setFont(new java.awt.Font("楷体",1,20));
        jlb2.setForeground(Color.BLUE);
        
        enroll.addActionListener(frm2);
        enrollyes.setFont(new java.awt.Font("楷体",1,20));
        enrollyes.setForeground(Color.BLUE);
        
        backpane.addActionListener(frm4);
        exit.addActionListener(frm4);
        
        bt[0].addActionListener(frm1);
        bt[1].addActionListener(frm1);
        bt[2].addActionListener(frm1);
        bt[3].addActionListener(frm1);
        bt[4].addActionListener(frm1);
        bt[5].addActionListener(frm1);
        bt[6].addActionListener(frm1);
        bt[7].addActionListener(frm1);
        
        backmajorpane.setBounds(340, 300, 150, 40);
        backmajorpane.setFont(new java.awt.Font("楷体",1,20));
        backmajorpane.setForeground(Color.BLUE);
        yes.addActionListener(bank0);
        yes1.addActionListener(bank1);
        backmajorpane.addActionListener(bank0);
        transbt1.addActionListener(bank2);
        
        passwordchange.addActionListener(bank4);
        
        informationbt1.addActionListener(bank5);
        
    }
    @SuppressWarnings("deprecation")
    public void actionPerformed(ActionEvent e)  {
        // TODO Auto-generated method stub
        JButton but=(JButton)e.getSource();
        if(but==bt1)
        {
            FileReader frname;
            FileReader frpassword;
            char[] c1=new char[500];
            char[] c2=new char[500];
            if(name.getText().equals("")&&String.valueOf(text.getPassword()).equals(""))
            {
                frm.setVisible(false);
                frm1.setBounds(350, 150, 600, 450);
                frm1.setVisible(true);
                frm1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            }
        }
        if(but==bt2)
        {
            enrollname.setText(null);
            enrollpassword.setText(null);
            frm.setVisible(false);
            frm2.setBounds(600, 150, 400, 350);
            enrollname.setBounds(140, 70, 160, 20);
            enrollpassword.setBounds(140, 120, 160, 20);
            enroll.setBounds(50, 200, 100, 20);
            backpane.setBounds(200, 200, 150, 20);
            frm2.add(enroll);
            frm2.add(backpane);
            frm2.add(jb1);
            frm2.add(jb2);
            frm2.setTitle("注册新账户");
            frm2.add(enrollname);
            frm2.add(enrollpassword);
            frm2.setVisible(true);
        }
        if(but==exitbt1)
        {
            frm3.setVisible(false);
        }
        if(but==bt3)
        {
            int n=JOptionPane.showConfirmDialog(this, "您确定要退出吗?","确认对话框",JOptionPane.YES_NO_OPTION);
            if(n==JOptionPane.YES_OPTION)
            {
                frm.setVisible(false);
                frm3.setBounds(350,150,400,300);
                frm3.setVisible(true);
                frm3.add(exitbt1);
                frm3.add(jlb2);
                frm3.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            }
            else if(n==JOptionPane.NO_OPTION)
            {
                frm.setVisible(true);
            }
        }
        if(but==enroll)
        {
            FileWriter fwname;
            FileWriter fwpassword;
            int n=JOptionPane.showConfirmDialog(this, "注册确认","确认对话框",JOptionPane.YES_NO_OPTION);
            if(n==JOptionPane.YES_OPTION)
            {
                try
                {
                    fwname=new FileWriter("e:\\java1\\账号.txt",true);
                    fwpassword=new FileWriter("e:\\java1\\密码.txt",true);
                    String stra=enrollname.getText();
                    String strb=enrollpassword.getText();
                    fwname.write(stra+"\r\n");
                    fwpassword.write(strb+"\r\n");
                    fwname.close();
                    fwpassword.close();
                    
                }catch(IOException e1){}
                frm2.setVisible(false);
                frm4.setVisible(true);
                frm4.setBounds(600, 150, 400, 300);
                enrollyes.setBounds(150, 80, 100, 20);
                frm4.add(enrollyes);
                backpane.setBounds(120, 150, 150, 20);
                frm4.add(backpane);
                frm4.add(exit);
            }   
        }
        if(but==backpane)
        {
            name.setText(null);
            text.setText(null);
            frm.add(jb1);
            frm.add(jb2);
            frm4.setVisible(false);
            frm2.setVisible(false);
            frm.setVisible(true);
        }
        if(but==exit)
        {
            frm4.setVisible(false);
            bank3.setVisible(false);
        }
        if(but==bt[0])
        {
            backmajorpane.setBounds(340, 300, 150, 40);
            backmajorpane.setFont(new java.awt.Font("楷体",1,20));
            backmajorpane.setForeground(Color.BLUE);
            frm1.setVisible(false);
            bank0.setVisible(true);
            bank0.setBounds(300, 100, 600, 450);
            setcash.setBounds(80, 150, 180, 20);
            setcash.setFont(new java.awt.Font("楷体",1,20));
            setcash.setForeground(Color.BLUE);
            setmoney.setBounds(260, 150, 200, 20);
            bank0.add(setcash);
            bank0.add(setmoney);
            bank0.add(backmajorpane);
            bank0.add(yes);
            yes.setBounds(70, 300, 150, 40);
            yes.setFont(new java.awt.Font("楷体",1,20));
            yes.setForeground(Color.BLUE);
        }
        if(but==yes)
        {
            bank0.setVisible(false);
            bank00.setVisible(true);
            bank00.setBounds(300, 100, 600, 450);
            setyes.setBounds(150, 150, 300, 40);
            setyes.setFont(new java.awt.Font("楷体",1,20));
            setyes.setForeground(Color.BLUE);
            backmajorpane.setBounds(40, 300, 150, 40);
            setyes.setText("存款金额:"+setmoney.getText()+"元      成功!");
            bank00.add(setyes);
            bank00.add(backmajorpane);
            bank00.add(exit);
        }
        if(but==backmajorpane)
        {
            bank0.setVisible(false);
            bank00.setVisible(false);
            frm1.setVisible(true);
            bank1.setVisible(false);
            bank11.setVisible(false);
            bank2.setVisible(false);
            bank22.setVisible(false);
            bank3.setVisible(false);
            bank33.setVisible(false);
            bank4.setVisible(false);
            bank44.setVisible(false);
            bank5.setVisible(false);
            bank55.setVisible(false);
            bank6.setVisible(false);
            bank66.setVisible(false);
            bank7.setVisible(false);
            bank77.setVisible(false);
        }
        if(but==exit)
        {
            bank00.setVisible(false);
            bank11.setVisible(false);
            bank22.setVisible(false);
            bank33.setVisible(false);
            bank44.setVisible(false);
            bank55.setVisible(false);
            bank66.setVisible(false);
            bank77.setVisible(false);
        }
        if(but==bt[1])
        {
            frm1.setVisible(false);
            bank1.setVisible(true);
            bank1.setBounds(300, 150, 600, 450);
            backmajorpane.setBounds(340, 300, 150, 40);
            backmajorpane.setFont(new java.awt.Font("楷体",1,20));
            backmajorpane.setForeground(Color.BLUE);
            frm1.setVisible(false);
            bank1.setVisible(true);
            bank1.setBounds(300, 100, 600, 450);
            getcash.setBounds(80, 150, 180, 20);
            getcash.setFont(new java.awt.Font("楷体",1,20));
            getcash.setForeground(Color.BLUE);
            getmoney.setBounds(260, 150, 200, 20);
            bank1.add(getcash);
            bank1.add(getmoney);
            bank1.add(backmajorpane);
            bank1.add(yes1);
            yes1.setBounds(70, 300, 150, 40);
            yes1.setFont(new java.awt.Font("楷体",1,20));
            yes1.setForeground(Color.BLUE);
            
        }
        if(but==yes1)
        {
            bank1.setVisible(false);
            bank11.setVisible(true);
            bank11.setBounds(300, 100, 600, 450);
            getyes.setBounds(150, 150, 300, 40);
            getyes.setFont(new java.awt.Font("楷体",1,20));
            getyes.setForeground(Color.BLUE);
            backmajorpane.setBounds(40, 300, 150, 40);
            getyes.setText("取款金额:"+getmoney.getText()+"元      成功!");
            bank11.add(getyes);
            bank11.add(backmajorpane);
            bank11.add(exit);
        }
        if(but==bt[2])
        {
            transjb3.setText(null);
            transjb2.setText(null);
            transjb1.setText(null);
            bank2.setTitle("转账功能");
            transjb3.setBounds(230,90,220,20);
            transjb2.setBounds(230, 150, 220, 20);
            transjb1.setBounds(230, 210, 220, 20);
            transbt1.setBounds(90, 300, 150, 40);
            transbt1.setFont(new java.awt.Font("楷体",1,20));
            transbt1.setForeground(Color.BLUE);
            frm1.setVisible(false);
            bank2.setVisible(true);
            bank2.setBounds(300, 150, 600, 450);
            backmajorpane.setBounds(340, 300, 150, 40);
            backmajorpane.setFont(new java.awt.Font("楷体",1,20));
            backmajorpane.setForeground(Color.BLUE);
            user.setFont(new java.awt.Font("楷体",1,20));
            user.setForeground(Color.BLUE);
            user.setBounds(90, 80, 150, 40);
            usercard.setBounds(90, 140, 150, 40);
            usercard.setFont(new java.awt.Font("楷体",1,20));
            usercard.setForeground(Color.BLUE);
            transmoney.setFont(new java.awt.Font("楷体",1,20));
            transmoney.setForeground(Color.BLUE);
            transmoney.setBounds(90, 200, 150, 40);
            bank2.add(backmajorpane);
            bank2.add(user);
            bank2.add(usercard);
            bank2.add(transmoney);
            bank2.add(transbt1);
            bank2.add(transjb1);
            bank2.add(transjb2);
            bank2.add(transjb3);
        }
        if(but==transbt1)
        {
            int n=JOptionPane.showConfirmDialog(this, "             转账确认!!!\n"+"转账人姓名:"+transjb3.getText(),"确认对话框",JOptionPane.YES_NO_OPTION);
            if(n==JOptionPane.YES_OPTION)
            {
                bank2.setVisible(false);
                bank22.setVisible(true);
                bank22.add(backmajorpane);
                backmajorpane.setBounds(40, 300, 150, 40);
                bank22.setBounds(300, 100, 600, 450);
                transyes1.setBounds(200, 100, 300, 20);
                transyes1.setFont(new java.awt.Font("楷体",1,15));
                transyes1.setForeground(Color.BLUE);
                transyes2.setBounds(200, 160, 300, 20);
                transyes2.setFont(new java.awt.Font("楷体",1,15));
                transyes2.setForeground(Color.BLUE);
                transyes3.setBounds(200, 220, 300, 20);
                transyes3.setFont(new java.awt.Font("楷体",1,15));
                transyes3.setForeground(Color.BLUE);
                transyes1.setText("转账成功!!!!");
                transyes2.setText("转账人:"+transjb3.getText());
                transyes3.setText("转账金额:"+transjb1.getText());
                bank22.add(transyes1);
                bank22.add(transyes2);
                bank22.add(transyes3);
                bank22.add(exit);
            }
        }
        if(but==bt[7])
        {
            int n=JOptionPane.showConfirmDialog(this, "确定要退出吗?","确认对话框",JOptionPane.YES_NO_OPTION);
            if(n==JOptionPane.YES_OPTION){
                frm1.setVisible(false);
                frm3.setBounds(350,150,400,300);
                frm3.setVisible(true);
                frm3.add(exitbt1);
                frm3.add(jlb2);
            }
        }
        if(but==bt[3])
        {
            frm1.setVisible(false);
            bank3.setVisible(true);
            bank3.setBounds(300, 100, 600, 450);
            nowmoney.setBounds(80, 150, 200, 20);
            nowmoney.setFont(new java.awt.Font("楷体",1,20));
            nowmoney.setForeground(Color.BLUE);
            moneytext1.setBounds(280, 150, 200, 20);
            moneytext1.setText(" "+1000);
            moneytext1.setEditable(false);
            backmajorpane.setBounds(80, 300, 150, 40);
            exit.setBounds(340, 300, 150, 40);
            bank3.add(nowmoney);
            bank3.add(moneytext1);
            bank3.add(backmajorpane);
            bank3.add(exit);
        }
        if(but==bt[4])
        {
            password1.setText(null);
            password2.setText(null);
            password3.setText(null);
            password9.setText(null);
            password10.setText(null);
            frm1.setVisible(false);
            bank4.setVisible(true);
            bank4.setBounds(300, 100, 600, 450);
            password4.setBounds(120, 80, 200, 20);
            password4.setFont(new java.awt.Font("楷体",1,20));
            password4.setForeground(Color.BLUE);
            password5.setBounds(120, 130, 200, 20);
            password5.setFont(new java.awt.Font("楷体",1,20));
            password5.setForeground(Color.BLUE);
            password6.setBounds(120, 180, 200, 20);
            password6.setFont(new java.awt.Font("楷体",1,20));
            password6.setForeground(Color.BLUE);
            password1.setBounds(240, 80, 200, 20);
            password2.setBounds(240, 130, 200, 20);
            password3.setBounds(240, 180, 200, 20);
            passwordchange.setBounds(80, 300, 150, 40);
            passwordchange.setFont(new java.awt.Font("楷体",1,20));
            passwordchange.setForeground(Color.BLUE);
            bank4.add(password1);
            bank4.add(password2);
            bank4.add(password3);
            bank4.add(password4);
            bank4.add(password5);
            bank4.add(password6);
            bank4.add(backmajorpane);
            bank4.add(passwordchange);
        }
        if(but==passwordchange)
        {
            if(text.getText().equals(password1.getText())&&password2.getText().equals(password3.getText())){
                bank4.setVisible(false);
                bank44.setVisible(true);
                bank44.setBounds(350, 150, 600, 450);
                password7.setBounds(120, 100, 300, 20);
                password7.setFont(new java.awt.Font("楷体",1,20));
                password7.setForeground(Color.BLUE);
                password8.setBounds(120, 180, 400, 20);
                password8.setFont(new java.awt.Font("楷体",1,20));
                password8.setForeground(Color.BLUE);
                backmajorpane.setBounds(80, 300, 150, 40);
                bank44.add(password7);
                bank44.add(password8);
                bank44.add(backmajorpane);
                bank44.add(exit);
            }
            else if((text.getText().equals(password1.getText())==false)&&(password2.getText().equals(password3.getText())==true))
            {
                password9.setText(null);
                password10.setText(null);
                password9.setText("原密码错误");
                password9.setBounds(450,80,100, 20);
                bank4.setVisible(false);
                bank4.setVisible(true);
                bank4.add(password9);
            }
            else if((text.getText().equals(password1.getText())==true)&&(password2.getText().equals(password3.getText())==false))
            {
                password9.setText(null);
                password10.setText(null);
                password10.setText("两次密码不一致");
                password10.setBounds(450, 180, 100, 20);
                bank4.setVisible(false);
                bank4.setVisible(true);
                bank4.add(password10);
            }
            else if((text.getText().equals(password1.getText())==false)&&(password2.getText().equals(password3.getText())==false))
            {
                password9.setText(null);
                password10.setText(null);
                password9.setText("原密码错误");
                password9.setBounds(450,80,100, 20);
                bank4.setVisible(false);
                bank4.setVisible(true);
                bank4.add(password9);
                password10.setText("两次密码不一致");
                password10.setBounds(450, 180, 100, 20);
                bank4.setVisible(false);
                bank4.setVisible(true);
                bank4.add(password10);
            }
        }
        if(but==bt[5])
        {
            bank5.setVisible(true);
            bank5.setBounds(500, 100, 300, 500);
            information1.setBounds(80,40, 80, 20);
            information2.setBounds(80,80, 80, 20);
            information3.setBounds(80,120, 80, 20);
            information4.setBounds(70,160, 80, 20);
            information5.setBounds(80,200, 80, 20);
            information6.setBounds(80,240, 80, 20);
            information7.setBounds(80,280, 80, 20);
            information8.setBounds(80,320, 80, 20);
            information9.setText(name.getText());
            information9.setBounds(135, 40, 150, 20);
            information10.setText(""+111);
            information10.setBounds(135, 80, 150, 20);
            information11.setText("取款");
            information11.setBounds(135, 120, 150, 20);
            information12.setText("ATM机");
            information12.setBounds(135, 160, 150, 20);
            information13.setText(c.get(Calendar.YEAR)+"-"+(c.get(Calendar.MONTH)+1)+"-"+c.get(Calendar.DAY_OF_MONTH));
            information13.setBounds(135, 200, 150, 20);
            information14.setText(c.get(Calendar.HOUR_OF_DAY)+":"+c.get(Calendar.MINUTE)+":"+c.get(Calendar.SECOND));
            information14.setBounds(135, 240, 150, 20);
            information15.setText(""+b);
            information15.setBounds(135, 280, 150, 20);
            information16.setText("中国工商银行");
            information16.setBounds(135, 320, 150, 20);
            informationbt1.setBounds(100, 400, 80, 20);
            bank5.add(information1);
            bank5.add(information2);
            bank5.add(information3);
            bank5.add(information4);
            bank5.add(information5);
            bank5.add(information6);
            bank5.add(information7);
            bank5.add(information8);
            bank5.add(information9);
            bank5.add(information10);
            bank5.add(information11);
            bank5.add(information12);
            bank5.add(information13);
            bank5.add(information14);
            bank5.add(information15);
            bank5.add(information16);
            bank5.add(information17);
            bank5.add(information18);
            bank5.add(informationbt1);
        }
        if(but==informationbt1)
        {
            bank5.setVisible(false);
        }
        if(but==bt[6])
        {
            frm1.setVisible(false);
            bank5.setVisible(true);
            bank5.setBounds(350, 150, 600, 450);
            accountjb1.setBounds(200, 20, 200, 20);
            accountjb1.setFont(new java.awt.Font("楷体",1,20));
            accountjb1.setForeground(Color.BLUE);
            account.setBounds(10, 50, 560, 320);
            bank5.add(accountjb1);
            bank5.add(account);
        }
    }
}
搜索更多相关主题的帖子: package 用户名 public import 密码 
2017-02-01 09:37
快速回复:一个银行账户系统,如何用文件保存和使用文件中的用户名,密码进行登陆 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.362834 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved