个人信息界面

package 个人信息界面;
import java.awt.*;
public class 个人信息界面  extends Frame{
 public 个人信息界面() //导入AWT包
 {
  super("个人信息");           //窗口标题
     this.setSize(280,300);    //组件尺寸
     this.setLocation(300, 240);  //组件的显示位置
     this.setBackground(Color.blue);  //组件的背景颜色
     this.setLayout(new FlowLayout());   //容器为流布局,居中
     this.add(new Label("姓名"));          //标签,添加到框架上
     this.add(new TextField("小小青",30));   //文本行,20列
     this.add(new Label("性别"));
     this.add(new TextField("女",30));
     this.add(new Label("爱好"));
     this.add(new TextField("打篮球",30));
     this.add(new Button("确认"));          //创建按钮
     this.add(new Button("返回"));
     this.setVisible(true);           //显示框架窗口,必须在添加组件后
 }
 public static void main (String arg[]){ new 个人信息界面();}
 }

 

posted on 2018-06-05 22:02  小小青🌸  阅读(218)  评论(0编辑  收藏  举报