private void init()
{
//获得屏幕的宽和高
int screenwidth = (int)Toolkit.getDefaultToolkit().getScreenSize().getWidth();
int screenheight = (int)Toolkit.getDefaultToolkit().getScreenSize().getHeight();
//创建一个默认不可见的窗体,设置其属性
int width = 300;
int height = 200;
fe = new Frame("我的Java");
fe.setBounds((screenwidth-width)/2, (screenheight-height)/2, width, height);
fe.setLayout(null);
//创建两个按钮
bn1 = new Button();
bn2 = new Button();
fe.add(bn1);
fe.add(bn2);
bn1.setBounds(10, 10, 10, 10);
bn2.setBounds(10, 20, 10, 10);
//创建两个文本框
td1 = new TextField(10);
td2 = new TextField(10);
fe.add(td1);
fe.add(td2);