用java做的gui版Atm

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjava.io.File;importjava.io.FileInputStream;importjava.io.FileNotFoundException;importjava.io.FileOutputStream;importjava.io.IOException;importjava.text.SimpleDateFormat;importjava.util.Date;importjava.util.ArrayList;importjavax.swing.ImageIcon;importjavax.swing.JButton;importjavax.swing.JFrame;importjavax.swing.JLabel;importjavax.swing.JOptionPane;importjavax.swing.JPanel;importjavax.swing.JPasswordField;importjavax.swing.JTabbedPane;importjavax.swing.JTextField;importjavax.swing.SwingConstants;publicclassAtmimplementsActionListener{SimpleDateFormatsdf=newSimpleDateFormat(yyyy年MM月dd日HH:mm:ss);JTabbedPanejTabbedPane;ArrayListUserarr=newArrayListUser();JFramejFrame;JButtonjButtonLogin;JButtonjButtonReset;JButtonjButtonEnglish;JButtonjButtonCreatCardNum;JButtonjButtonConfirm;JButtonjButtonRegisterReset;JButtonjButtonCheckBalance;JButtonjButtonCheckDetails;JButtonjButton100;JButtonjButton200;JButtonjButton300;JButtonjButton500;JButtonjButton1000;JButtonjButton2000;JButtonjButtonWithdrawConfirm;JButtonjButtonDepositeConfirm;JButtonjButtonTransferConfirm;JButtonjButtonTransferReset;JButtonjButtonChangeConfirm;JButtonjButtonChangeReset;JButtonjButtonExit;//登录JTextFieldjTextFieldCardNum;JPasswordFieldjPasswordFieldPass;//注册JTextFieldjTextFieldName;JTextFieldjTextFieldIdNum;JTextFieldjTextFieldAddr;JTextFieldjTextFieldPhoneNum;JTextFieldjTextFieldOtherPhoneNum;JPasswordFieldjPasswordFieldSetPass;JPasswordFieldjPasswordFieldConPass;JTextFieldjTextFieldDepositeAmount;JLabeljLabelCardNum2;//改密码JPasswordFieldjPasswordFieldChangePassOra;JPasswordFieldjPasswordFieldChangePassSet;JPasswordFieldjPasswordFieldChangePassConfirm;//取款JTextFieldjTextFieldWithdraw;JLabeljLabelWithdrawAmmout;//存款JTextFieldjTextFieldDepositAmount;//转账JTextFieldjTextFieldTransfer;JTextFieldjTextFieldTransferName;JTextFieldjTextFieldTransferAmount;//详细JPaneljp=newJPanel();//面板//JTextAreajta=new();//文本域//JScrollPanejsp=newJScrollPane(jta);//滚动条publicstaticvoidmain(String[]args){newAtm();}publicAtm(){jFrame=newJFrame(能力银行ATMClientBetav1.0);jFrame.setBounds(350,150,800,500);jFrame.setResizable(false);jFrame.setVisible(true);JPanelversion=newJPanel();JPaneljPanelLogin=newJPanel();JPaneljPanelRegister=newJPanel();JPaneljPanelCheck=newJPanel();JPaneljPanelWithdraw=newJPanel();JPaneljPanelDeposit=newJPanel();JPaneljPanelTransfer=newJPanel();JPaneljPanelChangePassword=newJPanel();JPaneljPanelExit=newJPanel();jTabbedPane=newJTabbedPane(SwingConstants.TOP);jTabbedPane.add(版本信息,version);jTabbedPane.add(登录窗口,jPanelLogin);jTabbedPane.add(注册窗口,jPanelRegister);jTabbedPane.add(查询窗口,jPanelCheck);jTabbedPane.add(取款窗口,jPanelWithdraw);jTabbedPane.add(存款窗口,jPanelDeposit);jTabbedPane.add(转账窗口,jPanelTransfer);jTabbedPane.add(修改密码,jPanelChangePassword);jTabbedPane.add(安全退出,jPanelExit);jTabbedPane.setEnabledAt(0,true);jTabbedPane.setEnabledAt(1,true);jTabbedPane.setEnabledAt(2,true);jTabbedPane.setEnabledAt(3,false);jTabbedPane.setEnabledAt(4,false);jTabbedPane.setEnabledAt(5,false);jTabbedPane.setEnabledAt(6,false);jTabbedPane.setEnabledAt(7,false);jTabbedPane.setEnabledAt(8,false);jFrame.add(jTabbedPane);JOptionPane.showMessageDialog(null,欢迎使用,请选择窗口);jTabbedPane.setSelectedIndex(0);/**Version**版本信息***/JLabeljLabelversion=newJLabel(版本:);JLabeljLabelversion1=newJLabel(v1.0);JLabeljLabelname=newJLabel(开发人员:李永光);JLabeljLabelname1=newJLabel(观看开发:田朝民);version.add(jLabelversion);version.add(jLabelversion1);version.add(jLabelname);version.add(jLabelname1);/**Login***/JLabeljLabelPic=newJLabel(newImageIcon(Img\\atm.jpg));jLabelPic.setBounds(0,0,800,200);JLabeljLabelCardNum=newJLabel(卡号:);jLabelCardNum.setBounds(250,250,80,25);jTextFieldCardNum=newJTextField();jTextFieldCardNum.setBounds(290,250,180,20);JLabeljLabelPass=newJLabel(密码:);jLabelPass.setBounds(250,275,80,25);jPasswordFieldPass=newJPasswordField();jPasswordFieldPass.setBounds(290,275,180,20);jButtonLogin=newJButton(登录);jButtonLogin.addActionListener(this);jButtonLogin.setBounds(250,320,60,25);//按钮尺寸jButtonReset=newJButton(重置);jButtonReset.addActionListener(this);jButtonReset.setBounds(320,320,60,25);jButtonEnglish=newJButton(English);jButtonEnglish.addActionListener(this);jButtonEnglish.setBounds(400,320,80,25);jPanelLogin.setLayout(null);jPanelLogin.add(jLabelCardNum);jPanelLogin.add(jTextFieldCardNum);jPanelLogin.add(jLabelPass);jPanelLogin.add(jLabelPass);jPanelLogin.add(jPasswordFieldPass);jPanelLogin.add(jButtonLogin);jPanelLogin.add(jButtonReset);jPanelLogin.add(jButtonEnglish);jPanelLogin.add(jLabelPic);/**Register**注册窗口,注册用户信息*用户姓名,身份证号,家庭住址,电话号码,其他电话,银行卡号,设置密码,确认密码,存入金额*注册之后返回登陆页面,进行登陆操作。***/JLabeljLabelName=newJLabel(用户姓名:);jLabelName.setBounds(250,50,80,25);jTextFieldName=newJTextField();jTextFieldName.setBounds(320,50,180,20);JLabeljLabelIdNum=newJLabel(身份证号:);jLabelIdNum.setBounds(250,75,80,25);jTextFieldIdNum=newJTextField();jTextFieldIdNum.setBounds(320,75,180,20);JLabeljLabelAddr=newJLabel(家庭住址:);jLabelAddr.setBounds(250,100,80,

1 / 25
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功