package com.yds.gui.threepart;
import java.awt.Button;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.Panel;
import java.awt.TextField;
public class Jishuan {
static Button b1, b2, b3, b4, b5, b6, b7, b8, b9;
static Button b11, b12, b13,b14;
public static void main(String[] args) {
Frame f = new Frame("计算器");
TextField tf = new TextField(10);
Panel p = new Panel();
p.setLayout(new GridLayout(3, 3));
b1 = new Button("1");
b2 = new Button("2");
b3 = new Button("3");
b4 = new Button("4");
b5 = new Button("5");
b6 = new Button("6");
b7 = new Button("7");
b8 = new Button("8");
b9 = new Button("9");
p.add(b1);
p.add(b2);
p.add(b3);
p.add(b4);
p.add(b5);
p.add(b6);
p.add(b7);
p.add(b8);
p.add(b9);
Panel p1 = new Panel();
p1.setLayout(new GridLayout(4,1));
b11 = new Button("+");
b12 = new Button("-");
b13 = new Button("*");
b14 = new Button("/");
p1.add(b11);p1.add(b12);p1.add(b13);p1.add(b14);
f.add(tf, "North");
f.add(p);
f.add(p1,"East");
f.pack();
f.setVisible(true);
}
}