ATM程序java实现(客户端+服务器)(共18页).doc
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《ATM程序java实现(客户端+服务器)(共18页).doc》由会员分享,可在线阅读,更多相关《ATM程序java实现(客户端+服务器)(共18页).doc(18页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上程序实现其实并不是很难,主要是思路,对程序的各个功能的设计,各个按钮的处理事件及按钮按照逻辑显示出来和隐藏。服务器采用多线程并行机制,针对每个用户登录创建一个线程。程序代码 客户端:import javax.swing.*;import .*;import java.io.*;import java.util.*;import java.awt.event.*;import java.awt.*;import java.sql.*;import java.math.*;import javax.swing.*;class ATMWindows extends JFra
2、me implements ActionListenerFont f;Socket clint=null;DataOutputStream out=null;DataInputStream in=null;Connection con;Statement pre;ResultSet rs;int i,money;boolean b=true;/b的取值有0,1,共2个值分别告诉程序该吧数字键盘的输入复制给username,password,String susername=null;String spassword=null;Box box1,box2,box3,box11,box12;JPa
3、nel panel1,panel2;JLabel tishi;JTextField username;JPasswordField password;JButton n,queding,chaxun,qukuan,tuichu;ATMWindows(String s)GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment();String t=ge.getAvailableFontFamilyNames();f=new Font(t67,Font.BOLD,16);n=new JButton10;box1=B
4、ox.createVerticalBox();box2=Box.createHorizontalBox();box3=Box.createVerticalBox();panel1=new JPanel();panel2=new JPanel();tishi=new JLabel(欢迎使用XX银行!请输入卡号。);tishi.setFont(f);username=new JTextField(20);password=new JPasswordField(20);panel1.setLayout(new GridLayout(3,3);panel2.setLayout(new GridLayo
5、ut(4,1);for(i=1;i=0&n.intValue()0)/余额大于等于0,表示用户可以取款out.writeInt(n.intValue();money=in.readInt();if(money=0)tishi.setText(登陆成功,您当前余额为:+money);chaxun.show(false);qukuan.show(true);box1.remove(password);box1.validate();return;else if(money=-1)tishi.setText(卡号错误请从新输入卡号和密码);susername=null;spassword=null;
6、box1.remove(password);box1.add(username);box1.validate();password.setText(null);username.setText(null);queding.show(true);chaxun.show(false);validate();return;else if(money=-2)tishi.setText(密码错误请从新输入密码!);spassword=null;password.setText(null);chaxun.show(false);queding.show(true);b=false;/用户输入密码错误,数字
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- ATM 程序 java 实现 客户端 服务器 18
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内