计算器代码(java) txt 计算器代码(java) 用快乐去奔跑,用心去倾听,用思维去发展, 用努力去奋斗, 用目标去衡量, 用爱去生活。钱多钱少, 常有就好!人老人少,健康就好!家贫家富,和睦就好。/*************************************** * 计算器程序***************************************/ import .*; import .*; import .*; public class Calculationer extends JFrame implements ActionListener { // 窗口组件 private JPanel panel = new JPanel(); private JTextField text = new JTextField(); private JButton[] number = new JButton[10]; private JButton bt1, bt2, bt3, bt4, bt5, bt6, bt7, bt8; String string = ""; //"画" 窗口 public Calculationer() { setTitle("Calculationer"); setResizable(false); for (int i= 0;i< 10; i++) { number[i] = new JButton("" + i); number[i].addActionListener(this); } (false); bt1 = new JButton("."); (this); bt2 = new JButton("="); (this); bt3 = new JButton("+"); (this); bt4 = new JButton("-"); (this); bt5 = new JButton("*"); (this); bt6 = new JButton("/"); (this); bt7 = new JButton(" √"); (this); bt8 = new JButton("C"); (this); (new GridLayout(6, 3, 7, 7)); for (int i= 7;i <= 9; i++) (number[i]); for (int i= 4;i <= 6; i++) (number[i]); for (int i= 1;i <= 3; i++) (number[i]); (number[0]); (bt
计算器代码(java) txt 来自淘豆网m.daumloan.com转载请标明出处.