科学计算器源代码.pdfVIP

  • 1
  • 0
  • 约2.62万字
  • 约 13页
  • 2020-09-10 发布于天津
  • 举报
package two; import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.io.*; import java.util.*; public class calculator implements ActionListener { int count = 0; private static int a; JFrame frame = new JFrame(计算器 ); JTextArea area = new JTextArea(); JTextField fieldshow = new JTextField(0); JTextField fieldcalculator = new JTextField(); JPanel leftpanel = new JPanel(); JPanel rightpanel = new JPanel(); JPanel buttonpanel = new JPanel(); JPanel motionpanel = new JPanel(); JButton button1 = new JButton(1); JButton button2 = new JButton(2); JButton button3 = new JButton(3); JButton button4 = new JButton(+); JButton button5 = new JButton(c); JButton button6 = new JButton(4); JButton button7 = new JButton(5); JButton button8 = new JButton(6); JButton button9 = new JButton(-); JButton button10 = new JButton(退格); JButton button11 = new JButton(7); JButton button12 = new JButton(8); JButton button13 = new JButton(9); JButton button14 = new JButton(*); JButton button15 = new JButton(sin); JButton button16 = new JButton(0); JButton button17 = new JButton(+/-); JButton button18 = new JButton(.); JButton button19 = new JButton(/); JButton button20 = new JButton(=); JButton button21 = new JButton(保存); JButton button22 = new JButton(复制); JButton button23 = new JButton(清除 ); StringBuffer S = new StringBuffer(); 精选文档 // t 用来记录前一个运算符号是 + - * / =中的哪一个 char t; // count 用来实现运算符号计数, a 用来识别退格、 正负号操作前一个操作是 否是运算符号 + - * / sin = // int count = 0, a = 0; Double x1, x2 = 0d, result; public static void main(String a[]) { calculator that = new calculator(); that

文档评论(0)

1亿VIP精品文档

相关文档