import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Frame;
import java.awt.Panel;
import java.awt.TextField;
public class Test_GUI extends Frame{
public Test_GUI(){
init();
southPanel();
centerPanel();
}
public void centerPanel() {
// TODO Auto-generated method stub
}
public void southPanel() {
// TODO Auto-generated method stub
Panel south = new Panel(); //创建panel
//创建文本字段存储ip地址
TextField tf = new TextField(15);
Button send = new Button("发送");//发送按钮
Button log = new Button("记录");//记录按钮
Button clear = new Button("清除");//清屏
Button shake = new Button("抖动");//振动按钮
south.add(tf);
south.add(send);
south.add(log);
south.add(clear);
south.add(shake);
this.add(south,BorderLayout.SOUTH);//将panel放在Fram的下面
}
public void init() {
this.setLocation(500,50);
this.setSize(400,600);
this.setVisible(true);
}
public static void main(String[] args) {
new Test_GUI();
//System.out.println("nihao ");
}
}
|