package bank;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.FileReader;
import java.io.Reader;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Properties;
import java.util.Vector;
public class customer extends JFrame implements ActionListener {
static CardLayout card = new CardLayout() ;
static Font font=new Font("宋体",Font.PLAIN,24); //设置统一的字体
static Font font2=new Font("宋体",Font.PLAIN,30);
static JPanel p1,p2,p3,p4,p5,p6;
static JPanel mainPanel = null ;
static String account ;
static String in1,in2,in3,in4;
static int f1,f2,f3,f4,f5; //判断标志
static JLabel b1,b2,b3,b4,b5; //作为背景的label
static ImageIcon bc1,bc2,bc3,bc4,bc5;
//第一块面板上的组件
static JButton withdraw,deposit,transfer,balance,record,quit;
static Vector<Serializable> v1,row,biaog;
static MyTableModel tableModel;
static JTable table;
static JScrollPane jsp;
//存款面板上的组件
static JLabel jine;
static JTextField tjine;
static JButton return1,confirm1;
//取款面板上的组件
static JButton q1,q2,q3,q4,q5,q6,q7,return2;
//转账面板上的组件
static JLabel zhanghu,jine2;
static JButton return3,confirm2;
static JTextField tzhanghu,tjine2;
//操作记录面板上的组件
static JButton return4;
//余额面板上的组件
static JLabel yue,tyue,ty;
static JButton return5;
static Container contentPane;
@SuppressWarnings("rawtypes")
public customer(String account1){
super("个人银行");
setUndecorated(true); //隐藏边框
contentPane = getContentPane();
contentPane.setLayout(card); //将主面板设置为卡片布局
setBounds(100,100,800,600);
account = account1;
f1=f2=f3=f4=f5=0;
bc1= new ImageIcon("background\\\\back1211.jpg");
bc2= new ImageIcon("background\\\\back1213.jpg");
bc3= new ImageIcon("background\\\\back1212.jpg");
bc4= new ImageIcon("background\\\\back1214.jpg");
bc5= new ImageIcon("background\\\\back1215.jpg");
b1= new JLabel(bc1);
b2= new JLabel(bc2);
b3= new JLabel(bc3);
b4= new JLabel(bc4);
b5= new JLabel(bc5);
b1.setBounds(0, 0, 800, 600);
b2.setBounds(0, 0, 800, 600);
b3.setBounds(0, 0, 800, 600);
b4.setBounds(0, 0, 800, 600);
b5.setBounds(0, 0, 800, 600);
//第一块面板上的组件
withdraw = new JButton("取款");
deposit = new JButton("存款");
transfer = new JButton("转账");
balance = new JButton("余额查询");
record = new JButton("操作记录");
quit = new JButton("退出");
//设置统一字体
withdraw.setFont(font);
deposit.setFont(font);
transfer.setFont(font);
balance.setFont(font);
record.setFont(font);
quit.setFont(font);
//设置按钮的精确位置
withdraw.setBounds(650,200,130,60);
deposit.setBounds(650,325,130,60);
transfer.setBounds(650,450,130,60);
balance.setBounds(20,200,130,60);
record.setBounds(20,325,130,60);
quit.setBounds(20,450,130,60);
//存款板上的组件
jine =new JLabel("存款金额");
tjine = new JTextField();
return1 = new JButton("返回");
confirm1 = new JButton("确认");
//设置字体
jine.setFont(font2);
tjine.setFont(font2);
return1.setFont(font2);
confirm1.setFont(font2);
//设置位置
jine.setBounds(200,200,130,60);
tjine.setBounds(350,200,220,60);
return1.setBounds(220,400,130,60);
confirm1.setBounds(430,400,130,60);
//取款面板上的组件设置
q1= new JButton("100");
q2= new JButton("200");
q3= new JButton("300");
q4= new JButton("500");
q5= new JButton("1000");
q6= new JButton("2000");
q7= new JButton("其他");
return2= new JButton("返回");
//设置字体
q1.setFont(font);
q2.setFont(font);
q3.setFont(font);
q4.setFont(font);
q5.setFont(font);
q6.setFont(font);
q7.setFont(font);
return2.setFont(font);
//设置位置
q1.setBounds(50,100,130,60);
q2.setBounds(50,200,130,60);
q3.setBounds(50,300,130,60);
q4.setBounds(50,400,130,60);
q5.setBounds(600,100,130,60);
q6.setBounds(600,200,130,60);
q7.setBounds(600,300,130,60);
return2.setBounds(600,400,130,60);
//转账面板上的组件设置
zhanghu =new JLabel("转入账户");
jine2 =new JLabel("金额");
tzhanghu = new JTextField();
tjine2 = new JTextField();
return3 = new JButton("返回");
confirm2= new JButton("确认转账");
//设置字体
zhanghu .setFont(font2);
jine2.setFont(font2);
tzhanghu.setFont(font2);
tjine2.setFont(font2);
return3.setFont(font2);
confirm2.setFont(font2);
//设置位置
zhanghu.setBounds(180,150,130,60);
jine2.setBounds(180,270,130,60);
tzhanghu.setBounds(330,150,300,60);
tjine2.setBounds(330,270,300,60);
return3.setBounds(200,400,160,60);
confirm2.setBounds(450,400,160,60);
//记录查询面板
v1 = new Vector(); //作为表头的向量
return4 = new JButton("返回");
v1.add("编号");
v1.add("账号");
v1.add("日期");
v1.add("类别");
v1.add("存取数额");
v1.add("经办人");
return4.setFont(font2);
return4.setBounds(0,500,100,40);
return4.addActionListener(this);
//余额面板
yue =new JLabel("您当前余额为:");
tyue =new JLabel("");
ty =new JLabel("元");
return5 = new JButton("返回");
yue.setFont(font2);
tyue.setFont(font2);
ty.setFont(font2);
return5.setFont(font2);
yue.setBounds(190,200,230,60);
tyue.setBounds(390,200,200,60);
ty.setBounds(500,200,200,60);
return5.setBounds(320,400,130,60);
//各个面板都设置为null布局
p1= new JPanel(null);
p2= new JPanel(null);
p3= new JPanel(null);
p4= new JPanel(null);
p5= new JPanel(null);
p6= new JPanel(null);
//各个子面板设置为与窗口同样大小
p1.setBackground(new Color(255, 255, 255, 250));
p2.setBackground(new Color(255, 255, 255, 250));
p3.setBackground(new Color(255, 255, 255, 250));
p4.setBackground(new Color(255, 255, 255, 250));
p5.setBackground(new Color(255, 255, 255, 250));
p6.setBackground(new Color(255, 255, 255, 250));
p1.add(withdraw);
p1.add(deposit);
p1.add(transfer);
p1.add(balance);
p1.add(record);
p1.add(quit);
p1.add(b1);
p2.add(jine);
p2.add(tjine);
p2.add(return1);
p2.add(confirm1);
p2.add(b2);
p3.add(q1);
p3.add(q2);
p3.add(q3);
p3.add(q4);
p3.add(q5);
p3.add(q6);
p3.add(q7);
p3.add(return2);
p3.add(b3);
p4.add(zhanghu);
p4.add(jine2);
p4.add(tzhanghu);
p4.add(tjine2);
p4.add(return3);
p4.add(confirm2);
p4.add(b4);
p5.add(yue);
p5.add(tyue);
p5.add(ty);
p5.add(return5);
p5.add(b5);
contentPane.add(p1,"p1");
contentPane.add(p2,"p2");
contentPane.add(p3,"p3");
contentPane.add(p4,"p4");
contentPane.add(p5,"p5");
contentPane.add(p6,"p6");
withdraw.addActionListener(this);
transfer.addActionListener(this);
deposit.addActionListener(this);
balance.addActionListener(this);
record.addActionListener(this);
quit.addActionListener(this);
return1.addActionListener(this);
confirm1.addActionListener(this);
q1.addActionListener(this);
q2.addActionListener(this);
q3.addActionListener(this);
q4.addActionListener(this);
q5.addActionListener(this);
q6.addActionListener(this);
q7.addActionListener(this);
return2.addActionListener(this);
return5.addActionListener(this);
return3.addActionListener(this);
confirm2.addActionListener(this);
setVisible(true);
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Java ATM银行系统.zip (37个子文件)
MyBank
bin
bank
login.class 7KB
openAccount$1.class 1KB
Administor.class 260B
login$1.class 555B
MyTableModel.class 395B
closeAccount$1.class 597B
index.class 3KB
openAccount$5.class 1KB
openAccount$4.class 1KB
closeAccount.class 7KB
openAccount.class 8KB
openAccount$2.class 1KB
customer.class 15KB
openAccount$3.class 1KB
config.properties 119B
background
back1213.jpg 103KB
back1211.jpg 115KB
back1215.jpg 103KB
back1212.jpg 101KB
back1214.jpg 103KB
back21.jpg 133KB
.settings
org.eclipse.jdt.core.prefs 598B
src
bank
customer.java 19KB
closeAccount.java 6KB
login.java 6KB
index.java 3KB
MyTableModel.java 264B
openAccount.java 9KB
config.properties 119B
.project 382B
.classpath 396B
icon
错误.png 1KB
正确.png 2KB
登录.png 758B
退出.png 1KB
开户1.png 1018B
销户2.png 793B
共 37 条
- 1
资源评论
- 行走的瓶子Yolo2023-07-28银行系统文件中的代码结构合理,代码风格规范,让我在阅读代码时感到舒适顺畅。
- 会飞的黄油2023-07-28文件中对于银行业务的处理方法简明易懂,帮助我更好地理解了银行系统的工作原理。
- 黄涵奕2023-07-28这个JAVA银行系统的设计思路清晰,功能齐全,给了我很好的学习参考。
- WaiyuetFung2023-07-28这个JAVA银行系统文件对于如何处理用户输入和错误处理给出了明确的指导,让我感受到作者的细致和负责。
- 丽龙2023-07-28文件中的注释详尽,解释了每个关键步骤的作用,对于理解JAVA银行系统的实现方式非常有帮助。
叮当猫的管家
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功