import java.awt.*;
import java.awt.event.*;
public class Js implements ActionListener{
//public Js() {
//}
public static void main (String[] args) {
Frame f =new Frame("计算器");
f.setSize(263,243);
f.setLayout(null);
f.setBackground(Color.gray);
Label l1=new Label();
Label l2=new Label();
l1.setSize(50,20);
l1.setLocation(9,30);
l1.setText("编辑");
l2.setSize(100,20);
l2.setLocation(100,30);
l2.setText("帮助");
f.add(l1);
f.add(l2);
TextField t=new TextField(50);
t.setSize(245,20);
t.setLocation(9,53);
f.add(t);
String name[]={"Backspace","CE","C","Time"};
for(int i=0;i<name.length;i++){
Button b=new Button(name[i]);
b.setSize(60,25);
b.setLocation(10+i*62,82);
f.add(b);
}
String a[][]={{"7","8","9","/","sqrt"},{"4","5","6","*","%"},
{"1","2","3","-","1/x"},{"0","+/-",".","+","="}};
for(int m=0;m<4;m++)
for(int n=0;n<5;n++)
{
Button c=new Button(a[m][n]);
f.add(c);
c.setSize(39,23);
c.setLocation(10+n*50,110+m*28);
//c.addActionListener(f);
}
f.setVisible(true);
}
public void actionPerformed(ActionEvent e){
}
}