import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.lang.Object;
public class ATM extends JFrame{
final static int WIDTH = 500 ;
final static int HEIGHT = 500 ;
static JPasswordField J0;
static JTextField J1,J2,J3,J4,J5,J6,J7,J8,J9,J10,J11,J12,J13;
static JButton Jb0,Jb1,Jb2,Jb3,Jb4,Jb5,Jb6,Jb7,Jb8,
Jb9,Jb10,Jb11,Jb12,Jb13,Jb14,Jb15,
Jb16,Jb17,Jb18,Jb19,Jb20,Jb21,Jb22,
Jb23,Jb24,Jb25,Jb26,Jb27,Jb28,Jb29,
Jb30,Jb31,Jb32,Jb33,Jb34,Jb35,Jb36,
Jb37;
static JLabel Jl0,Jl1,Jl2,Jl3,Jl4,Jl5,Jl6,
Jl7,Jl8,Jl9,Jl10,Jl11,Jl12,
Jl13,Jl14,Jl15;
static JTextArea JT1,JT2,JT3;
static int n,i=0,j=0,k=0;;
static String s1,s2,s3,s;
static String ID[] = new String[]{"2007118056",
"2007118057",
"2007118058",
"2007118059",
"2007118060",
"2007118061"
} ;
static int money []= new int[]{2100,2100,2100,2100,2100,2100};
static int avai[]= new int[]{2000,2000,2000,2000,2000,2000};
static int transavai[]= new int[]{2058,2058,2058,2058,2058,2058};
static String a[] = new String[]{""+money[0]+"",
""+money[1]+"",
""+money[2]+"",
""+money[3]+"",
""+money[4]+"",
""+money[5]+""};
static String mima1[] = new String []{"1","2","3","4","5","6"};
static String mima2[] = new String []{"6","5","4","3","2","1"};
static String b[] = new String[]
{""+avai[0]+"",
""+avai[1]+"",
""+avai[2]+"",
""+avai[3]+"",
""+avai[4]+"",
""+avai[5]+""};
static String c[] = new String[]{"1","1","1","1","1","1"};
int Count=0,num,balance,available,fee=0,flag=0,flag1=0,trans1=0,
trans2=0,countmoney=0,countfee=0,transmoney=0,transfee=0,
transnum,transmoney1,transfee1,transnum1,transavailable;
final Panel Panel0 = new Panel();
final Panel Panel1 = new Panel();
final Panel Panel2 = new Panel();
final Panel Panel3 = new Panel();
final Panel Panel4 = new Panel();
final Panel Panel5 = new Panel();
final Panel Panel6 = new Panel();
final Panel Panel7 = new Panel();
final Panel Panel8 = new Panel();
final Panel Panel9 = new Panel();
final Panel Panel10 = new Panel();
public static void main(String[] args){
ATM atm = new ATM ();
atm.setVisible(true);
atm.setSize(WIDTH, HEIGHT);
atm.addWindowFocusListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
}
public ATM(){
this.setTitle( "<<完美世界>>银行ATM模拟系统!");
this.setSize(WIDTH, HEIGHT);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setResizable(false);
//setLocation(0,80);
Container container = getContentPane();
container.setLayout(null);//FlowLayout
trans1 = balance / 100 ;
available = ((balance - trans1 * 2) / 100) *100;
trans2 = (balance - trans1 * 2) / 100;
countmoney = 0;countfee = 0;
//
ActionEventHandler handler = new ActionEventHandler();
//
Jb0 = new JButton("插卡口");
Jb0.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb0.setForeground(new Color(0,0,0));
Jb0.setBackground(new Color(174,233,233));
Jb0.addActionListener( handler);
Jb1 = new JButton("确定");
Jb1.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb1.setForeground(new Color(0,0,0));
Jb1.setBackground(new Color(174,233,233));
Jb1.addActionListener( handler);
Jb2 = new JButton("退卡");
Jb2.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb2.setForeground(new Color(0,0,0));
Jb2.setBackground(new Color(174,233,233));
Jb2.addActionListener( handler);
Jb3 = new JButton("返回");
Jb3.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb3.setForeground(new Color(0,0,0));
Jb3.setBackground(new Color(174,233,233));
Jb3.addActionListener( handler);
Jb4 = new JButton("境内卡");
Jb4.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb4.setForeground(new Color(0,0,0));
Jb4.setBackground(new Color(174,233,233));
Jb4.addActionListener( handler);
Jb5 = new JButton("境外卡");
Jb5.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb5.setForeground(new Color(0,0,0));
Jb5.setBackground(new Color(174,233,233));
Jb5.addActionListener( handler);
Jb6 = new JButton("退卡");
Jb6.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb6.setForeground(new Color(0,0,0));
Jb6.setBackground(new Color(174,233,233));
Jb6.addActionListener( handler);
Jb7 = new JButton("取款");
Jb7.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb7.setForeground(new Color(0,0,0));
Jb7.setBackground(new Color(174,233,233));
Jb7.addActionListener( handler);
Jb8 = new JButton("查询");
Jb8.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb8.setForeground(new Color(0,0,0));
Jb8.setBackground(new Color(174,233,233));
Jb8.addActionListener( handler);
Jb9 = new JButton("转账");
Jb9.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb9.setForeground(new Color(0,0,0));
Jb9.setBackground(new Color(174,233,233));
Jb9.addActionListener( handler);
Jb10 = new JButton("返回");
Jb10.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb10.setForeground(new Color(0,0,0));
Jb10.setBackground(new Color(174,233,233));
Jb10.addActionListener( handler);
Jb11 = new JButton("退卡");
Jb11.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb11.setForeground(new Color(0,0,0));
Jb11.setBackground(new Color(174,233,233));
Jb11.addActionListener( handler);
Jb12 = new JButton("确定");
Jb12.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb12.setForeground(new Color(0,0,0));
Jb12.setBackground(new Color(174,233,233));
Jb12.addActionListener( handler);
Jb13 = new JButton("返回");
Jb13.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb13.setForeground(new Color(0,0,0));
Jb13.setBackground(new Color(174,233,233));
Jb13.addActionListener( handler);
Jb14 = new JButton("退卡");
Jb14.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb14.setForeground(new Color(0,0,0));
Jb14.setBackground(new Color(174,233,233));
Jb14.addActionListener( handler);
Jb15 = new JButton("100元");
Jb15.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb15.setForeground(new Color(0,0,0));
Jb15.setBackground(new Color(174,233,233));
Jb15.addActionListener( handler);
Jb16 = new JButton("200元");
Jb16.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb16.setForeground(new Color(0,0,0));
Jb16.setBackground(new Color(174,233,233));
Jb16.addActionListener( handler);
Jb17 = new JButton("300元");
Jb17.setFont(new Font("黑体", Font.BOLD,18)); //set the Font family and size
Jb17.setForeground(new Color(0,0,0));
Jb17.setBackground(new Color(174,233,233));
Jb17.addAct