java按钮数组添加事件_java 如何将下列按钮用按钮数组和for循环表现出来,并且添加按纽监听器!...

b0=newButton("Backspace");b0.addActionListener(this);b1=newButton("CE");b1.addActionListener(this);b2=newButton("C");b2.addActionListener(this);b3=newButton("MC");b3.addA...

b0 = new Button("Backspace");

b0.addActionListener(this);

b1 = new Button("CE");

b1.addActionListener(this);

b2 = new Button("C");

b2.addActionListener(this);

b3 = new Button("MC");

b3.addActionListener(this);

b4 = new Button("MR");

b4.addActionListener(this);

b5 = new Button("MS");

b5.addActionListener(this);

b6 = new Button("M+");

b6.addActionListener(this);

b7 = new Button("7");

b7.addActionListener(this);

b8 = new Button("8");

b8.addActionListener(this);

b9 = new Button("9");

b9.addActionListener(this);

b10 = new Button("/");

b10.addActionListener(this);

b11 = new Button("平方根");

b11.addActionListener(this);

b12 = new Button("4");

b12.addActionListener(this);

b13 = new Button("5");

b13.addActionListener(this);

b14 = new Button("6");

b14.addActionListener(this);

b15 = new Button("*");

b15.addActionListener(this);

b16 = new Button("平方");

b16.addActionListener(this);

b17 = new Button("1");

b17.addActionListener(this);

b18 = new Button("2");

b18.addActionListener(this);

b19 = new Button("3");

b19.addActionListener(this);

b20 = new Button("-");

b20.addActionListener(this);

b21 = new Button("立方");

b21.addActionListener(this);

b22 = new Button("0");

b22.addActionListener(this);

b23 = new Button("+/-");

b23.addActionListener(this);

b24 = new Button(".");

b24.addActionListener(this);

b25 = new Button("+");

b25.addActionListener(this);

b26 = new Button("=");

b26.addActionListener(this);

展开

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值