Java+Swing+Mysql实现ATM自助存取款系统(2022最新版)

1.开发环境

开发工具:Eclipse2020 / Idea2020

JDK版本:jdk1.8

Mysql版本:5.7

2.技术选型

使用Java+Swing开发,用Mysql作为数据库。

3.系统功能

3.1. 注册

3.2.登录

3.3.取款

3.4.存款

3.5.转账

3.6.查询余额

3.1 新用户注册

image.png

3.2 登录界面

image.png

3.3 工作界面

支持背景图片,缴费充值,退出登录


image.png

3.4 存钱界面

image.png

3.5 取钱界面

image.png

3.6 转账界面

image.png

缴费充值

image.png

部分源码

RegisterFrame

package cn.itsub.atm;
import javax.swing.JLabel;
import javax.swing.JTextField;
import java.awt.Font;
import javax.swing.JButton;

public class RegisterFrame extends BaseFrame{
    private JTextField textField;
    private JTextField textField_1;
    private JTextField textField_2;
    private JTextField textField_3;
    public RegisterFrame() {
        getContentPane().setLayout(null);

        JLabel label1 = new JLabel("账号");
        label1.setBounds(95, 42, 54, 34);
        label1.setFont(FONT_20);

        getContentPane().add(label1);

        JLabel label2 = new JLabel("姓名");
        label2.setBounds(95, 97, 54, 35);
        getContentPane().add(label2);
        label2.setFont(FONT_20);

        JLabel label3 = new JLabel("密码");
        label3.setBounds(95, 156, 54, 33);
        getContentPane().add(label3);
        label3.setFont(FONT_20);

        textField = new JTextField();
        textField.setBounds(210, 42, 226, 36);
        getContentPane().add(textField);
        textField.setColumns(10);

        textField_1 = new JTextField();
        textField_1.setColumns(10);
        textField_1.setBounds(211, 99, 226, 36);
        getContentPane().add(textField_1);

        textField_2 = new JTextField();
        textField_2.setColumns(10);
        textField_2.setBounds(211, 156, 226, 36);
        getContentPane().add(textField_2);

        textField_3 = new JTextField();
        textField_3.setColumns(10);
        textField_3.setBounds(210, 211, 226, 36);
        getContentPane().add(textField_3);

        JLabel label3_1 = new JLabel("确认密码");
        label3_1.setFont(new Font("楷体", Font.PLAIN, 20));
        label3_1.setBounds(95, 214, 94, 33);
        getContentPane().add(label3_1);

        JButton btn1 = new JButton("提交注册");
        btn1.setBounds(293, 308, 138, 42);
        getContentPane().add(btn1);
        btn1.setFont(FONT_20);

        JButton btn_login = new JButton("去登录");
        btn_login.setFont(new Font("楷体", Font.PLAIN, 20));
        btn_login.setBounds(95, 308, 138, 42);
        getContentPane().add(btn_login);

        this.setSize(544, 411);
        this.setLocationRelativeTo(null);
        this.setTitle("新用户注册");
        this.setVisible(true);

    }

    public static void main(String[] args) {
        RegisterFrame rf = new RegisterFrame();

    }
}

image.gif

WorkFrame

package cn.itsub.atm;
import javax.swing.JButton;
import javax.swing.JLabel;
import java.awt.Font;

public class WorkFrame extends BaseFrame{

    public WorkFrame() {
        setLocation(0, -39);

        getContentPane().setLayout(null);

        JButton btn1 = new JButton("存钱");
        btn1.setBounds(44, 112, 135, 50);
        getContentPane().add(btn1);

        JButton btn2 = new JButton("取钱");
        btn2.setBounds(244, 112, 135, 50);
        getContentPane().add(btn2);

        JButton btn3 = new JButton("查询余额");
        btn3.setBounds(44, 203, 135, 50);
        getContentPane().add(btn3);

        JButton btn4 = new JButton("转账");
        btn4.setBounds(244, 203, 135, 50);
        getContentPane().add(btn4);

        JButton btn5 = new JButton("修改密码");
        btn5.setBounds(44, 295, 135, 50);
        getContentPane().add(btn5);

        JButton btn6 = new JButton("退出系统");
        btn6.setBounds(244, 295, 135, 50);
        getContentPane().add(btn6);

        btn1.setFont(FONT_25);
        btn2.setFont(FONT_25);
        btn3.setFont(FONT_25);
        btn4.setFont(FONT_25);
        btn5.setFont(FONT_25);
        btn6.setFont(FONT_25);

        JLabel lblNewLabel = new JLabel("\u60A8\u597D\uFF0C\u6B22\u8FCE\u8FDB\u5165\u7CFB\u7EDF");
        lblNewLabel.setFont(new Font("宋体", Font.PLAIN, 18));
        lblNewLabel.setBounds(44, 36, 335, 33);
        getContentPane().add(lblNewLabel);

        this.setSize(450, 430);
        this.setLocationRelativeTo(null);
        this.setTitle("欢迎使用ATM机");
        this.setVisible(true);
    }

    public static void main(String[] args) {
        new WorkFrame();
    }
}

image.gif

视频地址

源码下载

http://itsub.cn/course/48

你可能感兴趣的:(Java+Swing+Mysql实现ATM自助存取款系统(2022最新版))