Java项目:银行管理系统+文档Java基础Gui(java+Gui)
源码获取:博客首页 "资源" 里下载!
功能介绍:
登录、打印、取款、改密、转账、查询、挂失、存款、退卡
服务模块:
public class atmFrame extends JFrame {private JPanel contentPane;private user user;
// private LoginFrame lf;/*** Launch the application.*/public static void main(String[] args) {EventQueue.invokeLater(new Runnable() {public void run() {try {atmFrame frame = new atmFrame(null);frame.setVisible(true);} catch (Exception e) {e.printStackTrace();}}});}/*** Create the frame.*/public atmFrame(final String name) {setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);setBounds(100, 100, 518, 434);contentPane = new JPanel();setTitle(name);contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));setLocationRelativeTo(null);setContentPane(contentPane);contentPane.setLayout(null);JButton queryButton = new JButton("\u67E5\u8BE2");queryButton.setBounds(99, 101, 113, 27);contentPane.add(queryButton);queryButton.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) {user = ExecuteSQL.query(name);DecimalFormat df = new DecimalFormat( "0.00 "); JOptionPane.showMessageDialog(null,"您的账户名:"+user.getName()+"\n"+"当前余额:¥"+user.getbalance()+"\n","信息提示",JOptionPane.INFORMATION_MESSAGE); }});JButton depositButton = new JButton("\u5B58\u6B3E");depositButton.setBounds(99, 223, 113, 27);contentPane.add(depositButton);depositButton.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) {// TODO Auto-generated method stubdepositFrame df = new depositFrame(name);setVisible(false);df.setVisible(true);}});JButton withdrawButton = new JButton("\u53D6\u6B3E");withdrawButton.setBounds(288, 101, 113, 27);contentPane.add(withdrawButton);withdrawButton.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) {// TODO Auto-generated method stubwithdrawFrame wf = new withdrawFrame(name);setVisible(false);wf.setVisible(true);}});JButton transferButton = new JButton("\u8F6C\u8D26");transferButton.setBounds(288, 223, 113, 27);contentPane.add(transferButton);transferButton.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) {// TODO Auto-generated method stubtransferFrame wf = new transferFrame(name);setVisible(false);wf.setVisible(true);}});}}
登录模块:
public class LoginFrame extends JFrame {private JPanel contentPane;private JTextField u_name_Field;private JPasswordField u_password_field;private user user;//登录事件监听器class loginAction implements ActionListener {public void actionPerformed(ActionEvent e) {// TODO Auto-generated method stubuser = ExecuteSQL.check(u_name_Field.getText(), u_password_field.getText());if (user.getName() != null) {if (user.getPassword().equals(u_password_field.getText())) {try {atmFrame frame = new atmFrame(user.getName());frame.setTitle(user.getName());frame.setVisible(true);setVisible(false);} catch (Exception ex) {ex.printStackTrace();}} else {JOptionPane.showMessageDialog(null, "密码不正确!请重新输入");u_name_Field.setText("");u_password_field.setText("");}} else {JOptionPane.showMessageDialog(null, "找不到该用户,请先注册!");u_name_Field.setText("");u_password_field.setText("");}}}//注册事件监听器class signAction implements ActionListener{public void actionPerformed(ActionEvent e) {// TODO Auto-generated method stubSignFrame frame = new SignFrame();frame.setVisible(true);setVisible(false);}}/*** Launch the application.*/public static void main(String[] args) {EventQueue.invokeLater(new Runnable() {public void run() {try {LoginFrame frame = new LoginFrame();frame.setVisible(true);} catch (Exception e) {e.printStackTrace();}}});}/*** Create the frame.*/public LoginFrame() {setTitle("\u7F51\u4E0A\u94F6\u884C");setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);setBounds(100, 100, 506, 385);contentPane = new JPanel();setLocationRelativeTo(null);contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));setContentPane(contentPane);contentPane.setLayout(null);JButton LoginButton = new JButton("\u767B\u5F55");LoginButton.setFont(new Font("新宋体", Font.BOLD, 20));LoginButton.setBounds(92, 214, 120, 37);contentPane.add(LoginButton);LoginButton.addActionListener(new loginAction());JButton signButton = new JButton("\u6CE8\u518C");signButton.setFont(new Font("新宋体", Font.BOLD, 20));signButton.setBounds(283, 214, 113, 37);contentPane.add(signButton);signButton.addActionListener(new signAction());JLabel u_nameLabel = new JLabel("\u7528\u6237\u540D\uFF1A");u_nameLabel.setFont(new Font("新宋体", Font.BOLD, 18));u_nameLabel.setBounds(92, 49, 88, 37);contentPane.add(u_nameLabel);JLabel u_passwordLabel_1 = new JLabel("\u5BC6\u7801\uFF1A");u_passwordLabel_1.setFont(new Font("新宋体", Font.BOLD, 18));u_passwordLabel_1.setBounds(92, 130, 88, 27);contentPane.add(u_passwordLabel_1);u_name_Field = new JTextField();u_name_Field.setBounds(184, 57, 157, 29);contentPane.add(u_name_Field);u_name_Field.setColumns(10);u_password_field = new JPasswordField();u_password_field.setBounds(184, 133, 157, 27);contentPane.add(u_password_field);JLabel lblNewLabel = new JLabel("\u7528\u6237\u6307\u5357");lblNewLabel.setForeground(Color.RED);lblNewLabel.setBounds(402, 307, 72, 31);contentPane.add(lblNewLabel);}
}
收回框设置:
public class withdrawFrame extends JFrame {private JPanel contentPane;private JTextField outputField;private com.shao.model.user user_query;private com.shao.model.user user_modMoney;/*** Create the frame.*/public withdrawFrame(final String name) {setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);setBounds(100, 100, 450, 300);contentPane = new JPanel();setTitle(name);setLocationRelativeTo(null);contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));setContentPane(contentPane);contentPane.setLayout(null);JLabel lblNewLabe = new JLabel("\u53D6\u6B3E\u91D1\u989D\uFF1A");lblNewLabe.setFont(new Font("新宋体", Font.BOLD, 20));lblNewLabe.setBounds(84, 75, 117, 38);contentPane.add(lblNewLabe);outputField = new JTextField();outputField.setBounds(199, 84, 117, 24);contentPane.add(outputField);outputField.setColumns(10);JButton OKButton = new JButton("\u786E\u5B9A");OKButton.setFont(new Font("新宋体", Font.BOLD, 15));OKButton.setBounds(84, 159, 113, 27);contentPane.add(OKButton);OKButton.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {// TODO Auto-generated method stubSystem.out.println("withdrawFrame.withdrawFrame(...).new ActionListener() {...}.actionPerformed()"+outputField.getText());if (Float.parseFloat(outputField.getText()) < 100000) {if(Float.parseFloat(outputField.getText())%100==0) {user_query = ExecuteSQL.query(name);if (user_query.getbalance() > Double.parseDouble(outputField.getText())) {double temp = user_query.getbalance() - Double.parseDouble(outputField.getText());DecimalFormat df = new DecimalFormat( "0.00 "); int i = ExecuteSQL.modifyMoney(name, temp); if(i>0){setVisible(false);atmFrame frame = new atmFrame(name);frame.setVisible(true);JOptionPane.showMessageDialog(null, "取钱交易成功!"+"\n" + "剩余余额为:" + df.format(temp));}else{JOptionPane.showMessageDialog(null, "取钱交易失败!"+"\n" + "剩余余额为:" + df.format(temp));}} else {JOptionPane.showMessageDialog(null, "余额不足,请重新输入!" + "\n" + "当前余额为:" + user_query.getbalance());outputField.setText("");}}else {JOptionPane.showMessageDialog(null, "系统不支持非100元整钞,请重新输入!");outputField.setText("");}} else {JOptionPane.showMessageDialog(null, "输入金额大于100000,请重新输入!");outputField.setText("");}}});JButton backButton_1 = new JButton("\u8FD4\u56DE");backButton_1.setFont(new Font("新宋体", Font.BOLD, 15));backButton_1.setBounds(233, 159, 113, 27);contentPane.add(backButton_1);backButton_1.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e) {atmFrame af = new atmFrame(name);setVisible(false);af.setVisible(true); } });JLabel remindLabel = new JLabel("*\u5355\u7B14\u6700\u5927\u53EF\u53D610000");remindLabel.setForeground(Color.RED);remindLabel.setBounds(199, 126, 138, 18);contentPane.add(remindLabel);}}
源码获取:博客首页 "资源" 里下载!
Java项目:银行管理系统+文档Java基础Gui(java+Gui)相关推荐
- 基于java的汽车管理系统+文档
博主介绍:✌在职Java研发工程师.专注于程序设计.源码分享.技术交流.专注于Java技术领域和毕业设计✌ 项目名称 基于java的汽车管理系统+文档 视频效果 https://www.bilibil ...
- (三)java项目中的文档转换案例实战——Word2003(doc)版本转换为HTML网页
前言 由于在开发中需要适配不同的多端应用,在文件相关处理中也会存在相同的问题,需要将文档转换为不同的格式展示,本节我们主要通过一个小案例实现在java环境下实现 Word2003(doc)转换为HTM ...
- (五)java项目中的文档转换案例实战——Word转换为PDF
前言 由于在开发中需要适配不同的多端应用,在文件相关处理中也会存在相同的问题,需要将文档转换为不同的格式展示,本节我们主要通过一个小案例实现在java环境下实现Word2003(doc). Word2 ...
- java 转换上传文档_自己编写JAVA环境下的文件上传组件 (转)
客户端上传后,端的数据流头尾部格式如下,这里上传了一个文档 我们看看数据流的头部: -----------------------------7d22f821706e0Content-Disposit ...
- springboot+vue学生综合测评系统(java项目源码+文档)
风定落花生,歌声逐流水,大家好我是风歌,混迹在java圈的辛苦码农.今天要和大家聊的是一款基于springboot的学生综合测评系统.项目源码以及部署相关请联系风歌,文末附上联系信息 .
- springboot+vue项目之MOBA类游戏攻略分享平台(java项目源码+文档)
风定落花生,歌声逐流水,大家好我是风歌,混迹在java圈的辛苦码农.今天要和大家聊的是一款基于springboot的MOBA类游戏攻略分享平台.项目源码以及部署相关请联系风歌,文末附上联系信息 .
- java如何打开word文档_如何在Java中打开和操作Word文档/模板?
我知道自从我发布这个问题以来已经很长时间了,我说我会在完成后发布我的解决方案. 所以在这里. 我希望有一天它会帮助某人. 这是一个完整的工作类,您只需将它放在应用程序中,并将TEMPLATE_DIRE ...
- 利用java实现android项目结构API文档
利用java实现android项目结构API文档 2012-11-16 快速生成API文档列表 在android项目中的.CLASSPATH文件里添加android.jar路径 例如: <cla ...
- java编码规范文档 下载_软件项目实训及课程设计指导——制定待开发项目中各种文档的规范...
软件项目实训及课程设计指导--制定待开发项目中各种形式文档的规范 1.制定对课程设计项目开发过程中的规范性要求 (1)从"形式"到"内容"两个方面控制和要求开发 ...
最新文章
- 自绘制HT For Web ComboBox下拉框组件
- hadoop 全分布式部署
- gbk文件转为utf8文件
- Vue.js 打造酷炫的可视化数据大屏
- 【TensorFlow-windows】学习笔记七——生成对抗网络
- 百度地图android绘图类,Class:android总类/android离线地图类
- 64位 regsrv win10_Win10 64位安装个人版SQL2000图文教程
- mysql字段编码转换_mysql字符集编码转换
- 百度产品经理vs 腾讯产品经理:技术大牛与小白
- Web应用功能测试测试点
- 【Elasticsearch】如何在 Elasticsearch 中轻松编写脚本
- 解决类似 /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found 的问题
- php与XML、XSLT、Mysql的结合运用 (转载)
- 有道无术,术可求;有术无道,止于术
- android高德地图瓦片,高德地图加载瓦片分析
- chrome、Firefox、IE浏览器和驱动下载地址
- proc oracle12c,Oracle12cRAC安装遭遇CLSRSC-507: The root script cannot proceed on this node
- 802.1q协议 VLAN的三种接口特性(Access、Trunk、Hybrid)简要分析
- DIV+CSS实现旅游网站首页
- 模拟黑洞图像_全息图像模拟黑洞计划一一物理学家们的下一个宏伟目标