欢迎来到天天文库
浏览记录
ID:39682413
大小:98.50 KB
页数:21页
时间:2019-07-09
《ATM机银行项目(java图形界面)》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、登陆packagecom.userland;importjava.awt.HeadlessException;importjava.awt.Label;importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjavax.swing.JButton;importjavax.swing.JFrame;importjavax.swing.JPanel;/***欢迎界面*@authorAdministrator
2、**/publicclassWelcomelandextendsJFrame{JPanelp1;privateJButtonbtn1;Labellabel;staticJframUserLandjf=null;publicWelcomeland(Stringarg0)throwsHeadlessException{super(arg0);setSize(800,600);p1=newJPanel();label=newLabel("XX银行欢迎登陆!");btn1=newJButton("登陆"
3、);btn1.addActionListener(newMyActionListner());p1.add(btn1);p1.add(label);setContentPane(p1);}publicstaticvoidmain(String[]args){WelcomelandmyJframe=newWelcomeland("XX银行欢迎登陆!");myJframe.setVisible(true);}classMyActionListnerimplementsActionListener{@
4、OverridepublicvoidactionPerformed(ActionEventarg0){Objecto=arg0.getSource();if(o==btn1){jf=newJframUserLand("XX银行欢迎登陆!");jf.pack();setVisible(false);jf.setVisible(true);}}}}packagecom.userland;importjava.awt.Frame;importjava.awt.GridLayout;importjava
5、.awt.HeadlessException;importjava.awt.Label;importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjava.io.BufferedReader;importjava.io.FileInputStream;importjava.io.FileNotFoundException;importjava.io.IOException;importjava.io.In
6、putStreamReader;importjavax.swing.JButton;importjavax.swing.JFrame;importjavax.swing.JPanel;importjavax.swing.JPasswordField;importjavax.swing.JTextField;importcom.action.JframBank;/***登陆界面*@authorAdministrator**/publicclassJframUserLandextendsJFrame
7、{privateJButtonbtn1,btn2;staticJTextFieldt1;staticJPasswordFieldt2;JPanelp1;publicJframUserLand(Stringarg0)throwsHeadlessException{super(arg0);setSize(800,600);p1=newJPanel();Framef=newFrame("用户登录");f.setLayout(newGridLayout(4,2));btn2=newJButton("确认
8、");btn2.addActionListener(newMyActionListner());t1=newJTextField("输入用户名",15);t2=newJPasswordField("输入密码",15);f.add(newLabel("用户名:",Label.CENTER));p1.add(t1);f.add(newLabel("密码:",Label.CENTER));p1.add(t2);p1.add(btn2);setContentPane(p1);this.setVisibl
此文档下载收益归作者所有