基于java+mysql的swing+mysql银行atm管理系统(java+mysql+swing)

基于java+mysql的swing+mysql银行atm管理系统(java+mysql+swing)

私信源码获取及调试交流

运行环境

Java≥8、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

基于java的Swing+MySQL银行ATM管理系统(java+mysql+swing)

启动类:LoginFrame

登录用户:

user1 123456

user2 123456

user3 123456

功能:查询余额、取款、存款、转账

        int i = 0;
        String sql = "insert into bank(name,password,balance)"
                + "values('" + name + "','" + password + "','" + 0 + "')";
        i = ExecuteSQL.executeUpdate(sql);
        ExecuteSQL.close();
        return i;

    }

    //查询用户信息
    public static user query(String name) {
        user u = new user();
        String sql = "select name,balance from bank where name = '" + name + "'";
        ResultSet rs = ExecuteSQL.executeQuery(sql);
        try {
            while (rs.next()) {
                u.setName(rs.getString("name"));
                u.setbalance(rs.getDouble("balance"));
            }
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        ExecuteSQL.close();
        return u;
    }

    // 修改账户的余额
    public static int modifyMoney(String name, double balance) {
        user u = new user();
        String sql = "update  bank set balance = '" + balance + "' where name ='" + name + "'";
        int i = ExecuteSQL.executeUpdate(sql);
        ExecuteSQL.close();
        return i;
    }
}

		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 stub
				System.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("");
				}

			}
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        ExecuteSQL.close();
        return u;
    }

    // 修改账户的余额
    public static int modifyMoney(String name, double balance) {
        user u = new user();
        String sql = "update  bank set balance = '" + balance + "' where name ='" + name + "'";
        int i = ExecuteSQL.executeUpdate(sql);
        ExecuteSQL.close();
        return i;
    }
}

public class LoginFrame extends JFrame {

	private JPanel contentPane;
	private JTextField u_name_Field;
	private JPasswordField u_password_field;
	private user user;


public class SignFrame extends JFrame {

	private JPanel contentPane;
	private JTextField u_name;
	private JPasswordField u_password;
	private JPasswordField u_password_1;
	private user user;

	
	//注册按钮监听器
	class OKButtonAction implements ActionListener {

		public void actionPerformed(ActionEvent e) {
			// TODO Auto-generated method stub
			if (!u_name.getText().equals("")) {
				if (!u_password.getText().equals("")) {
					if (!u_password_1.getText().equals("")) {
						if (u_password.getText().equals(u_password_1.getText())) {
							user = ExecuteSQL.check(u_name.getText(), u_password.getText());
							if (!u_name.getText().equals(user.getName())) {
								 ExecuteSQL.addUser(u_name.getText(), u_password.getText());
								setVisible(false);
								LoginFrame frame = new LoginFrame();
								frame.setVisible(true);
								JOptionPane.showMessageDialog(null, "注册成功,可以继续登录!");
							} else {
								JOptionPane.showMessageDialog(null, "用户名已经存在!");
							}
						} else {
							JOptionPane.showMessageDialog(null, "密码确认不符!");
						}

					} else {
						JOptionPane.showMessageDialog(null, "未输入确认密码!");
					}

				} else {
					JOptionPane.showMessageDialog(null, "未输入密码!");
				}
			} else {
				JOptionPane.showMessageDialog(null, "未输入用户名!");
			}
		}

	}

	/**
	 * Create the frame.
	public depositFrame(final String name) {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 492, 354);
		setTitle(name);
		setLocationRelativeTo(null);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblNewLabel = new JLabel("\u8F93\u5165\u91D1\u989D\uFF1A");
		lblNewLabel.setFont(new Font("新宋体", Font.BOLD, 20));
		lblNewLabel.setBounds(80, 92, 121, 27);
		contentPane.add(lblNewLabel);
		
		inputField = new JTextField();
		inputField.setBounds(225, 95, 133, 24);
		contentPane.add(inputField);
		inputField.setColumns(10);
		
		JButton OKButton = new JButton("\u786E\u8BA4");
		OKButton.setFont(new Font("新宋体", Font.BOLD, 15));
		OKButton.setBounds(102, 188, 113, 27);
		contentPane.add(OKButton);
		OKButton.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
//				if(money1%100==0) {
				System.out.println(inputField.getText()+"存款");
				if(Float.parseFloat(inputField.getText())<100000){
					if(Float.parseFloat(inputField.getText())%100==0) {
						user_query = ExecuteSQL.query(name);
						double temp = user_query.getbalance()+Double.parseDouble(inputField.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));
		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 stub
				System.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("");
				}

			}

            } else
                return;
        } catch (Exception ee) {
            ee.printStackTrace();
        }

    }

    //重写executeQuer方法
    //返回ResultSet结果集
    private static ResultSet executeQuery(String sql) {
        try {
            if (conn == null)
                new ExecuteSQL();
            return conn.createStatement().executeQuery(sql);//ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE
        } catch (SQLException e) {
            e.printStackTrace();
            return null;
        } finally {
        }
    }

    //重写executeUpdate方法
    private static int executeUpdate(String sql) {
        try {
            if (conn == null)
                new ExecuteSQL();
            return conn.createStatement().executeUpdate(sql);
        } catch (SQLException e) {
            System.out.println(e.getMessage());
            return -1;
        } finally {
        }
    }

    public static void close() {
        try {
            conn.close();
        } catch (SQLException e) {
            e.printStackTrace();
						inputField.setText("");
					}
									
				}else{
					JOptionPane.showMessageDialog(null, "输入金额大于1000000,请重新输入!");
					inputField.setText("");
				}				
			}
			
		});
		
		JButton backButton_1 = new JButton("\u8FD4\u56DE");
		backButton_1.setFont(new Font("新宋体", Font.BOLD, 15));
		backButton_1.setBounds(268, 188, 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 lblNewLabel_1 = new JLabel("*\u9650\u989D100000");
		lblNewLabel_1.setForeground(Color.RED);
		lblNewLabel_1.setFont(new Font("新宋体", Font.PLAIN, 15));
		lblNewLabel_1.setBounds(369, 98, 105, 18);
		contentPane.add(lblNewLabel_1);
	}
}

		
		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 static void close() {
        try {
            conn.close();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            conn = null;
        }
    }

    //登录测试账号 密码
    public static user check(String name, String password) {
        int i = 0;
        user u = new user();
        String sql = "select name, password from bank where name = '" + name + "'";
        ResultSet rs = ExecuteSQL.executeQuery(sql);
        try {
            while (rs.next()) {
                u.setName(rs.getString("name"));
                u.setPassword(rs.getString("password"));
                //	u.setbalance(rs.getFloat("balance"));
            }
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        ExecuteSQL.close();
        return u;
    }

    //注册,添加用户信息
    public static int addUser(String name, String password) {
        int i = 0;
        String sql = "insert into bank(name,password,balance)"
                + "values('" + name + "','" + password + "','" + 0 + "')";
        i = ExecuteSQL.executeUpdate(sql);
        ExecuteSQL.close();
        return i;

    }

	}
}

public class depositFrame extends JFrame {

	private JPanel contentPane;
	private JTextField inputField;
	private user user_query;
	private user user_modMoney;

	/**
	 * Create the frame.
	 */
	public depositFrame(final String name) {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 492, 354);
		setTitle(name);
		setLocationRelativeTo(null);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblNewLabel = new JLabel("\u8F93\u5165\u91D1\u989D\uFF1A");
		lblNewLabel.setFont(new Font("新宋体", Font.BOLD, 20));
		lblNewLabel.setBounds(80, 92, 121, 27);
		contentPane.add(lblNewLabel);
		
		inputField = new JTextField();
		inputField.setBounds(225, 95, 133, 24);
		contentPane.add(inputField);
		inputField.setColumns(10);
		
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 527, 358);
		setTitle(name);
		setLocationRelativeTo(null);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblNewLabel = new JLabel("\u8F6C\u8D26\u7528\u6237\u540D\uFF1A");
		lblNewLabel.setFont(new Font("新宋体", Font.BOLD, 20));
		lblNewLabel.setBounds(105, 72, 126, 30);
		contentPane.add(lblNewLabel);
		
		out_nameField = new JTextField();
		out_nameField.setBounds(245, 77, 150, 24);
		contentPane.add(out_nameField);
		out_nameField.setColumns(10);
		
		JLabel lblNewLabel_1 = new JLabel("\u8F6C\u8D26\u91D1\u989D\uFF1A");
		lblNewLabel_1.setFont(new Font("新宋体", Font.BOLD, 20));
		lblNewLabel_1.setBounds(105, 141, 112, 30);
		contentPane.add(lblNewLabel_1);
		
		out_moneyField = new JTextField();
		out_moneyField.setBounds(243, 146, 152, 24);
		contentPane.add(out_moneyField);
		out_moneyField.setColumns(10);
		
		JButton OKButton = new JButton("\u786E\u8BA4");
		OKButton.setFont(new Font("新宋体", Font.BOLD, 17));
		OKButton.setBounds(104, 225, 113, 27);
		contentPane.add(OKButton);
		OKButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				int res = JOptionPane.showConfirmDialog(null, "确认此次转账?", "转账确认", JOptionPane.YES_NO_OPTION);
				if (res == JOptionPane.YES_OPTION) {
					user_query_deposit = ExecuteSQL.query(out_nameField.getText());//转出钱
					if (out_nameField.getText().equals(user_query_deposit.getName())) {
						if (Float.parseFloat(out_moneyField.getText()) < 100000) {
							if(Float.parseFloat(out_moneyField.getText())%100==0) {
								user_query_withdraw = ExecuteSQL.query(name);
								// user_1 = ExecuteSQL.query(out_nameField);
								if (user_query_withdraw.getbalance() > Double.parseDouble(out_moneyField.getText())) {
									double temp = user_query_withdraw.getbalance() - Double.parseDouble(out_moneyField.getText());
									double temp_1 = user_query_deposit.getbalance() + Double.parseDouble(out_moneyField.getText());
									DecimalFormat df = new DecimalFormat("0.00 ");
									int i_withdraw = ExecuteSQL.modifyMoney(name, temp);
									int i_deposit = ExecuteSQL.modifyMoney(out_nameField.getText(), temp_1);
									if(i_withdraw>0 && i_deposit>0){
										setVisible(false);
										atmFrame frame = new atmFrame(name);
					}
					
				} 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);
	}

}

public class SignFrame extends JFrame {

	private JPanel contentPane;
	private JTextField u_name;
		backButton_1.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e) {
				atmFrame af = new atmFrame(name);
				setVisible(false);
				af.setVisible(true);			
			}		
		});
	}

}

public class ExecuteSQL {
    protected static String dbClassName = "com.mysql.jdbc.Driver";
    protected static String dbUrl = "jdbc:mysql://localhost:3306/project?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true&failOverReadOnly=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull";
    protected static String dbUser = "root";
    protected static String dbPwd = "123456";
    private static Connection conn = null;

    private ExecuteSQL() {
        try {
            if (conn == null) {
                Class.forName(dbClassName).newInstance();
                conn = DriverManager.getConnection(dbUrl, dbUser, dbPwd);
            } else
                return;
        } catch (Exception ee) {
            ee.printStackTrace();
        }

    }


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);
            return -1;
        } finally {
        }
    }

    public static void close() {
        try {
            conn.close();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            conn = null;
        }
    }

    //登录测试账号 密码
    public static user check(String name, String password) {
        int i = 0;
        user u = new user();
        String sql = "select name, password from bank where name = '" + name + "'";
        ResultSet rs = ExecuteSQL.executeQuery(sql);
        try {
            while (rs.next()) {
                u.setName(rs.getString("name"));
                u.setPassword(rs.getString("password"));
                //	u.setbalance(rs.getFloat("balance"));
            }
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        ExecuteSQL.close();
        return u;
    }

    //注册,添加用户信息
    public static int addUser(String name, String password) {
        int i = 0;
        String sql = "insert into bank(name,password,balance)"
                + "values('" + name + "','" + password + "','" + 0 + "')";
        i = ExecuteSQL.executeUpdate(sql);
        ExecuteSQL.close();

}

public class ExecuteSQL {
    protected static String dbClassName = "com.mysql.jdbc.Driver";
    protected static String dbUrl = "jdbc:mysql://localhost:3306/project?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true&failOverReadOnly=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull";
    protected static String dbUser = "root";
    protected static String dbPwd = "123456";
    private static Connection conn = null;

    private ExecuteSQL() {
        try {
            if (conn == null) {
                Class.forName(dbClassName).newInstance();
                conn = DriverManager.getConnection(dbUrl, dbUser, dbPwd);
            } else
                return;
        } catch (Exception ee) {
            ee.printStackTrace();
        }

    }

    //重写executeQuer方法
    //返回ResultSet结果集
    private static ResultSet executeQuery(String sql) {
        try {
            if (conn == null)
                new ExecuteSQL();
            return conn.createStatement().executeQuery(sql);//ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE
        } catch (SQLException e) {
            e.printStackTrace();
            return null;
        } finally {
        }
    }

    //重写executeUpdate方法
    private static int executeUpdate(String sql) {
        try {
		inputField.setColumns(10);
		
		JButton OKButton = new JButton("\u786E\u8BA4");
		OKButton.setFont(new Font("新宋体", Font.BOLD, 15));
		OKButton.setBounds(102, 188, 113, 27);
		contentPane.add(OKButton);
		OKButton.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
//				if(money1%100==0) {
				System.out.println(inputField.getText()+"存款");
				if(Float.parseFloat(inputField.getText())<100000){
					if(Float.parseFloat(inputField.getText())%100==0) {
						user_query = ExecuteSQL.query(name);
						double temp = user_query.getbalance()+Double.parseDouble(inputField.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, "系统不支持非100元整钞,请重新输入!");
						inputField.setText("");
					}
									
				}else{
					JOptionPane.showMessageDialog(null, "输入金额大于1000000,请重新输入!");
					inputField.setText("");
				}				
			}
			
		});
		
		JButton backButton_1 = new JButton("\u8FD4\u56DE");
		backButton_1.setFont(new Font("新宋体", Font.BOLD, 15));
		backButton_1.setBounds(268, 188, 113, 27);
		contentPane.add(backButton_1);

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

  • 9
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
通讯录管理系统是一个基于Java编程语言和MySQL数据库的应用程序,用于帮助用户有效地管理他们的联系人信息。这个系统采用了Swing框架来构建直观友好的用户界面,使用户能够方便地添加、编辑、删除和搜索联系人信息。 系统的主要功能包括以下几个方面:首先,在系统中,用户可以创建一个新的联系人条目,并输入姓名、电话号码、电子邮件地址等联系信息。其次,用户可以编辑已有联系人的信息,比如更新电话号码、修改电子邮件地址等。此外,系统还提供了删除联系人的功能,用户可以根据需要删除不再需要的联系人信息。 此外,这个通讯录管理系统还具有一个搜索功能,用户可以输入关键词来查找特定的联系人信息。系统将会根据用户提供的关键词进行匹配,并且显示与之匹配的联系人信息。 在技术实现方面,系统使用了Java语言进行编码,并且依赖于MySQL数据库来存储联系人信息。通过Java语言和MySQL数据库的组合,系统能够实现数据的持久化,确保联系人信息在系统关闭后不会丢失。 同时,系统采用了Swing框架来构建用户界面,利用Swing的各种组件,如文本框、按钮、下拉框等,来设计直观友好的界面,使用户能够轻松上手并且方便操作。 总的来说,这个基于JavaMySQLSwing的通讯录管理系统,为用户提供了一个方便高效的方式来管理联系人信息,帮助用户更好地组织和利用自己的通讯录。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值