简易计算器代码

时间:2015-04-05 12:11:41
【文件属性】:

文件名称:简易计算器代码

文件大小:2KB

文件格式:TXT

更新时间:2015-04-05 12:11:41

计算器

简易计算器 import java.awt.event.*; import java.awt.*; import javax.swing.*; public class jisuanqi extends JApplet implements ActionListener { JTextField tf1=new JTextField(20); JButton bt1[]=new JButton[10]; JButton bt2[]=new JButton[4]; JButton bt3=new JButton("="); JButton bt4=new JButton("ESC"); String s1[]={"0","1","2","3","4","5","6","7","8","9"}; String s2[]={"+","-","*","/"}; String s3,s4; public void init() { Container cp=getContentPane(); cp.setLayout(new FlowLayout()); cp.add(tf1); for(int i=0;i


网友评论