import java.awt.*;public class FrameTest extends Frame{
static final int xsize = 300;
static final int ysize = 320;
public FrameTest(){
super("display a rect....");
resize(xsize,ysize);
TextField ts=new TextField("你好吗,我的亲亲....",30);
Button b = new Button("i love you");
Button b2 = new Button("you love me");
b2.move(50,50);
Panel p= new Panel();
p.setLayout(new FlowLayout(CENTER));
p.setBackground(Color.lightGray);
p.add(ts);
p.add(b);
p.add(b2);
add(p);
}
public static void main(String[] args){
Frame frame = new FrameTest();
                  frame.show();
}
public boolean handleEvent(Event evt){
if (evt.id == Event.WINDOW_DESTROY){
System.exit(0);
//frame.hide();
}
return false;
}
}