ATM柜员机模拟程序

/*账户1234567890密码123456*/
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.File;
import javax.swing.*;
public class ATM柜员机模拟程序 {static String mima ="123456";double cunqian = 0;double quqian = 0;double yue=0;private ATM柜员机模拟程序() throws Exception {File destDir=null;File destFile=null;destDir = new File("D:\\code");if(!destDir.exists()) {destDir.mkdir();}destFile = new File(destDir,"code.txt");if(!destFile.exists()) {destFile.createNewFile();}JFrame frm1 = new JFrame();frm1.setLayout(null);JTextArea text1 = new JTextArea("\n 欢迎使用网上银行自助服务");JTextArea text2 = new JTextArea();JPasswordField text3 = new JPasswordField();JButton btn = new JButton("< 登      录 >");frm1.add(btn);btn.setBackground(Color.red);Font g = new Font("楷体",Font.BOLD,20);btn.setFont(g);btn.setBounds(280, 250, 200, 100);frm1.add(text1 );frm1.add(text2);frm1.add(text3);JLabel lab1,lab2; lab1 = new JLabel("账   号:");lab2 = new JLabel("密   码:");frm1.add(lab1);frm1.add(lab2);text1.setBounds(10, 20, 460, 120);lab1.setBounds(50, 150, 100, 20);lab2.setBounds(50, 180, 100, 20);frm1.setBounds(500, 400, 500, 400);text2.setBounds(150, 150, 100,20);text3.setBounds(150, 180, 100, 20);text1.setBackground(Color.BLUE);Font f = new Font("黑体",Font.BOLD,33);text1.setFont(f);text1.setForeground(Color.RED);lab1.setForeground(Color.gray);lab2.setForeground(Color.gray);text1.setEditable(false);frm1.setVisible(true);frm1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);btn.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent arg0) {@SuppressWarnings("deprecation")String password = text3.getText();if(text2.getText().toString().equals("1234567890")&&password.equals(mima)) {frm1.setVisible(false);set();}else new JDialog();}});}private void set() {JButton btn1,btn2,btn3,btn4,btn5,btn6;JTextArea text1;JFrame frm = new JFrame();text1 = new JTextArea();btn1 = new JButton("余额查询");btn2 = new JButton("取       款");btn3 = new JButton("存       钱");btn4 = new JButton("密码修改");btn5 = new JButton(" < 退 出");btn6 = new JButton(" 遇 到 问 题 > ");frm.add(text1);frm.add(btn1);frm.add(btn2);frm.add(btn3);frm.add(btn4);frm.add(btn5);frm.add(btn6);frm.setVisible(true);frm.setBounds(500, 400, 500, 400);frm.setLayout(null);text1.setBounds(0, 0, 300, 300);Font f = new Font("",Font.BOLD,33);text1.setText("\n\n☺ 您好 , 欢迎使用\n              ATM !");text1.setFont(f);text1.setForeground(Color.gray);text1.setBackground(Color.BLUE);text1.setEditable(false);btn1.setBounds(300,0,200,100);btn1.setBackground(Color.cyan);btn2.setBounds(300,100,200,50);btn2.setBackground(Color.cyan);btn3.setBounds(300,150,200,100);btn3.setBackground(Color.cyan);btn4.setBounds(300,250,200,50);btn4.setBackground(Color.cyan);btn5.setBackground(Color.RED);btn6.setBackground(Color.GREEN);btn5.setBounds(0, 300, 200, 35);btn6.setBounds(300, 300, 200, 35);frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);btn1.addMouseListener(new MouseListener() {public void mouseClicked(MouseEvent arg0) {JOptionPane.showMessageDialog(null, "您的可用余额为"+yue+"元","余额查询",JOptionPane.PLAIN_MESSAGE);}public void mouseEntered(MouseEvent arg0) {btn1.setBackground(Color.red);}public void mouseExited(MouseEvent arg0) {btn1.setBackground(Color.CYAN);}public void mousePressed(MouseEvent arg0) {}public void mouseReleased(MouseEvent arg0) {}});btn2.addMouseListener(new MouseListener() {public void mouseClicked(MouseEvent arg0) {JFrame frm = new JFrame();frm.setLayout(null);frm.setBounds(500, 400, 300, 250);JButton btn1 = new JButton("确 定");JLabel lab = new JLabel("请输入要提取的金额");lab.setBounds(50, 25, 150, 25);lab.setForeground(Color.gray);JTextArea text = new JTextArea();text.setBounds(50, 60, 100, 20);text.setBackground(Color.gray);frm.add(text);frm.add(lab);btn1.setBounds(150, 150, 100, 20);frm.add(btn1);btn1.setBackground(Color.red);frm.setVisible(true);btn1.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent arg0) {frm.setVisible(false);quqian = Double.valueOf(text.getText());if(yue<quqian)JOptionPane.showMessageDialog(null, "余额不足,请充值", "取钱",JOptionPane.PLAIN_MESSAGE);else{yue = yue-quqian;JOptionPane.showMessageDialog(null, "提取金额"+quqian+"成功", "取钱",JOptionPane.PLAIN_MESSAGE);}}});}public void mouseEntered(MouseEvent arg0) {btn2.setBackground(Color.red);}public void mouseExited(MouseEvent arg0) {btn2.setBackground(Color.CYAN);}public void mousePressed(MouseEvent arg0) {}public void mouseReleased(MouseEvent arg0) {}});btn3.addMouseListener(new MouseListener() {public void mouseClicked(MouseEvent arg0) {JFrame frm = new JFrame();frm.setLayout(null);frm.setBounds(500, 400, 300, 250);JButton btn1 = new JButton("确 定");JLabel lab = new JLabel("请输入要存入的金额");lab.setBounds(50, 25, 150, 25);lab.setForeground(Color.gray);JTextArea text = new JTextArea();text.setBounds(50, 60, 100, 20);text.setBackground(Color.gray);frm.add(text);frm.add(lab);btn1.setBounds(150, 150, 100, 20);frm.add(btn1);btn1.setBackground(Color.red);frm.setVisible(true);btn1.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent arg0) {cunqian = Double.valueOf(text.getText());yue = yue+cunqian;frm.setVisible(false);JOptionPane.showMessageDialog(null, "存入金额"+cunqian+"成功", "存钱",JOptionPane.PLAIN_MESSAGE);}});}public void mouseEntered(MouseEvent arg0) {btn3.setBackground(Color.red);}public void mouseExited(MouseEvent arg0) {btn3.setBackground(Color.CYAN);}public void mousePressed(MouseEvent arg0) {}public void mouseReleased(MouseEvent arg0) {}});btn4.addMouseListener(new MouseListener() {public void mouseClicked(MouseEvent arg0) {JFrame frm = new JFrame();frm.setLayout(null);frm.setBounds(500, 400, 300, 250);JButton btn1 = new JButton("确 定");JLabel lab = new JLabel("请输入要修改的密码");lab.setBounds(50, 25, 150, 25);lab.setForeground(Color.gray);JTextArea text = new JTextArea();text.setBounds(50, 60, 100, 20);text.setBackground(Color.gray);frm.add(text);frm.add(lab);btn1.setBounds(150, 150, 100, 20);frm.add(btn1);btn1.setBackground(Color.red);frm.setVisible(true);btn1.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent arg0) {mima=text.getText().toString();frm.setVisible(false);JOptionPane.showMessageDialog(null, "修改密码成功,请记住你的当前密码", "修改密码",JOptionPane.PLAIN_MESSAGE);}});}public void mouseEntered(MouseEvent arg0) {btn4.setBackground(Color.RED);}public void mouseExited(MouseEvent arg0) {btn4.setBackground(Color.CYAN);}public void mousePressed(MouseEvent arg0) {}public void mouseReleased(MouseEvent arg0) {}});btn5.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent arg0) {frm.setVisible(false);try {new ATM柜员机模拟程序();} catch (Exception e) {e.printStackTrace();}}});btn6.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent arg0) {JOptionPane.showMessageDialog(null, "请咨询:客服电话:198********\n"+"                  qq :2424******", "遇到问题",JOptionPane.QUESTION_MESSAGE);}                                      });}public static void main(String[] args) throws Exception {new ATM柜员机模拟程序();}
}





ATM柜员机人机界面相关推荐

  1. ATM柜员机JAVA课程设计_ATM柜员机学年论文设计(Java课程设计)

    内容简介: ATM柜员机学年论文设计(Java课程设计),共23页,4599字,附源程序. 一. 程序介绍3 二. 开发环境搭建3 1. MyEclipse 5.5.1 GA安装3 2. MyEcli ...

  2. ATM柜员机模拟程序

    要求:设计一个程序,当输入给定的卡号和密码(初始卡号和密码为123456)时,系统能登录ATM柜员机系统,用户可以按照以下规则进行: 查询余额:初始余额为10000元 ATM取款:每次取款金额为100 ...

  3. ATM柜员机模拟系统

    题目 ATM柜员机模拟系统 设计要求:使用图形用户界面.要求:当输入给定的卡号和密码(初始卡号和密码为123456)时,系统能登录ATM柜员机系统,用户可以按照以下规则进行:1.查询余额:初始余额为1 ...

  4. ATM柜员机JAVA课程设计_JAVA课程设计报告银行ATM机系统.doc

    JAVA课程设计报告银行ATM机系统 Java课程设计报告 题 目 银行ATM机系统 所在院系 软件学院 学生姓名 金磊 专 业 R机械+软件 班 级 R机械094 学 号 2011年 7 月 15日 ...

  5. atm柜员机模拟程序c语言,ATM自动取款机模拟程序

    个人讲解 学员刘同学以高中文凭在学习过1个月后C和C++语言基础后,成功完成了本实践. 实践目的 制作这个代码的目的就是实践ATM机的一些简单功能,题目要求如下: 定义1个结构体类型ACCOUNT_S ...

  6. 《软件工程》实验个人报告,南风银行ATM自动柜员机 开发总结报告; 滁州学院课程

    1.实验项目概述 1.1.项目简介 我们小组的项目是南风银行ATM系统,作为软件工程课程的实验项目,我们通过课程实验八个课程的学习.小组集成项目的开发工作,历时八周,基本实现了由计算机控制的持卡人自我 ...

  7. 基于JavaSwing ATM取款机系统的设计和实现

    本项目演示地址链接  > 前言: 本项目是使用Java swing开发,可实现ATM系统/银行系统的基本登陆.转账.查询余额.存取款业务.界面设计比较简介.适合作为Java课设设计以及学习技术使 ...

  8. c语言模仿atm源代码,C语言ATM程序模拟

    <C语言ATM程序模拟>由会员分享,可在线阅读,更多相关<C语言ATM程序模拟(18页珍藏版)>请在人人文库网上搜索. 1.一. 课题要求1. 当输入给定的卡号和密码(初始卡号 ...

  9. java atm柜机_java课程设计-ATM柜机模拟程序.doc

    java课程设计-ATM柜机模拟程序 课程设计(大作业)报告课程名称:面向对象程序设计课程设计 设计题目:ATM柜员机模拟程序 院 系:信息技术学院 班 级: 设 计 者: 学 号: 指导教师: 设计 ...

最新文章

  1. 别在 Java 代码里乱打日志了,这才是正确的打日志姿势
  2. #include Windows.h 和 Winsock2.h冲突的改进解决方案
  3. 居民信息管理系统java_基于jsp的社区住户信息管理系统-JavaEE实现社区住户信息管理系统 - java项目源码...
  4. java正则表达式 引用_java – 正则表达式检索引用的字符串和引用字符
  5. 排名前20的网页爬虫工具,超多干货
  6. 【感想文】感情经历,是否给你我带来的些许提升?我想,有。
  7. java多线程必须掌握吗_多线程模式有什么作用(java多线程必须掌握的知识)
  8. 网站开发用什么语言好_网站开发教程:企业如何用网站开启在线业务?
  9. 语言 ota_新增飞屏功能 ARCFOX αT首次OTA升级
  10. 集中管理:领导者,不能不考虑的几件事之——“挖”出来的无限可能
  11. 为什么拼多多价格那么便宜,他们是怎么赚钱的,货源从哪里来的?
  12. 密度图的密度估计_R-ggridges包:山峰叠峦图
  13. html如何实现表格效果,DIV+CSS技术实现类似table表格的效果
  14. 英特尔的指令集体系结构_英特尔下一代Tremont的Jasper Lake系产品面世
  15. 图片处理--处理成灰色图片,高斯模糊
  16. VMware Workstation Pro 15安装和Win 10虚拟机安装
  17. 存储 - emmc ufs nvme
  18. 印章、拿金币、数字游戏
  19. 视频封面如何统一修改怎么设置为同一张图片
  20. ThinkPad电脑黑屏只显示鼠标

热门文章

  1. 国际货运代理行业分析
  2. const引用const指针以及constexpr
  3. 生活随记-自卑无法消除
  4. c语言,c++中的%d,%f等的用法
  5. 顷刻之间 「复原时光」,美图画质修复算法V2全新上线
  6. 如何利用python抖音涨粉代码_Python实现抖音关键词热度搜索小程序(附源码)
  7. 安卓自动点击软件 开维控制精灵
  8. 中国式家长计算机入门怎么去的,中国式家长新手入门怎么玩_新手入门注意事项...
  9. CSS3 总结(二十一)——BFC
  10. sql server中区分大小写全半角