java中atm小项目,简单的ATM,java小项目,可是遇到迷茫的错,救!!!

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

package niit.com;

import java.awt.Button;

import java.awt.Color;

import java.awt.GridLayout;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.awt.event.WindowAdapter;

import java.awt.event.WindowEvent;

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JPanel;

import javax.swing.JTextArea;

import javax.swing.JTextField;

public class ATMFrame extends JFrame {

StringBuffer str;

GridLayout gl1,gl2,gl3,gl4,gl5;

JPanel p0,p1,p2,p3,p4;

JButton btn0,btn1,btn2,btn3,btn4,btn5,btn6,btn7,btn8,btn9,btn10,btn11,btn12,btn13,btn14,btn15,btn16;

JTextField tf1,tf2;

JTextArea ta1;

ATMFrame()

{

gl1=new GridLayout(1,1,40,0);

gl2=new GridLayout(4,1,5,0);

gl3=new GridLayout(4,3,10,10);

gl4=new GridLayout(1,1,200,0);

gl5=new GridLayout(1,1,280,0);

tf1=new JTextField(280);

//tf1.setBounds(80, 320, 320, 40);

//tf1.setHorizontalAlignment(JTextField.BOTTOM);

tf1.setEnabled(false);

tf1.setText("0");

tf2=new JTextField(80);

tf2.setBounds(5,135, 80, 40);

//tf2.setHorizontalAlignment(JTextField.WEST);

tf2.setEnabled(false);

tf2.setText("0");

ta1=new JTextArea(" ",1,1);

btn0=new JButton("First Java Bank ATM");

btn0.setForeground(Color.red);

btn0.addActionListener(new Bt());

btn1=new JButton("Display AccountBalance");

btn1.setForeground(Color.blue);

btn1.addActionListener(new Bt());

btn2=new JButton("Make a desposit");

btn2.setForeground(Color.blue);

btn2.addActionListener(new Bt());

btn3=new JButton("Make a withdraw");

btn3.setForeground(Color.blue);

btn3.addActionListener(new Bt());

btn4=new JButton("1");

btn4.setForeground(Color.blue);

btn4.addActionListener(new Bt());

btn5=new JButton("2");

btn5.setForeground(Color.blue);

btn5.addActionListener(new Bt());

btn6=new JButton("3");

btn6.setForeground(Color.blue);

btn6.addActionListener(new Bt());

btn7=new JButton("4");

btn7.setForeground(Color.blue);

btn7.addActionListener(new Bt());

btn8=new JButton("5");

btn8.setForeground(Color.blue);

btn8.addActionListener(new Bt());

btn10=new JButton("6");

btn10.setForeground(Color.blue);

btn10.addActionListener(new Bt());

btn11=new JButton("7");

btn11.setForeground(Color.blue);

btn11.addActionListener(new Bt());

btn12=new JButton("8");

btn12.setForeground(Color.blue);

btn12.addActionListener(new Bt());

btn13=new JButton("9");

btn13.setForeground(Color.blue);

btn13.addActionListener(new Bt());

btn14=new JButton("0");

btn14.setForeground(Color.blue);

btn14.addActionListener(new Bt());

btn15=new JButton("Sure");

btn15.setForeground(Color.blue);

btn15.addActionListener(new Bt());

btn9=new JButton(".");

btn9.setForeground(Color.blue);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值