Java计算器系统功能_JAVA实现计算器功能

我这有个实现计算器功能的源码...是别人写的...谁帮我注释下...有些看不懂...谢谢啦....importjava.awt.*;importjavax.swing.*;importjava.awt.event.*;classCTextendsWindowAdapter{...

我这有个实现计算器功能的源码...是别人写的...谁帮我注释下...有些看不懂...谢谢啦....import java.awt.*;import javax.swing.*;import java.awt.event.*;class CT extends WindowAdapter{ static JFrame f=new JFrame("计算器"); static JTextField text1=new JTextField("0."); static String source=""; static String cal=""; static String object=""; static boolean flag=false; static boolean flag1=true; static boolean flag2=false; public void init() {  try  {   Container c=f.getContentPane();   JPanel pan1=new JPanel();   JButton b1=new JButton("1");   JButton b2=new JButton("2");   JButton b3=new JButton("3");   JButton b4=new JButton("4");   JButton b5=new JButton("5");   JButton b6=new JButton("6");   JButton b7=new JButton("7");   JButton b8=new JButton("8");   JButton b9=new JButton("9");   JButton b0=new JButton("0");   JButton b11=new JButton("+");   JButton b12=new JButton("-");   JButton b13=new JButton("*");   JButton b14=new JButton("/");   JButton b15=new JButton(".");   JButton b16=new JButton("=");   JButton bclar=new JButton("重置");   text1.setHorizontalAlignment(JTextField.RIGHT);   c.add(text1,"North");   c.add(pan1);   A aa=new A();   Result re=new Result();   Opertion op=new Opertion();   Clar cl=new Clar();   b1.addActionListener(aa);   b2.addActionListener(aa);   b3.addActionListener(aa);   b4.addActionListener(aa);   b5.addActionListener(aa);   b6.addActionListener(aa);   b7.addActionListener(aa);   b8.addActionListener(aa);   b9.addActionListener(aa);   b0.addActionListener(aa);   b11.addActionListener(op);   b12.addActionListener(op);   b13.addActionListener(op);   b14.addActionListener(op);   b16.addActionListener(re);   b15.addActionListener(aa);   bclar.addActionListener(cl);

展开

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值