1. 程式人生 > >個人信息顯示

個人信息顯示

導入 分享 gree IE 返回 you 個人 顯示 ets

技術分享圖片

package 個人信息;
import java.awt.*;
public class 個人信息 extends Frame
{
public 個人信息() //導入AWT包
{
super("我的信息"); //窗口標題
this.setSize(280,300); //組件尺寸
this.setLocation(300, 240); //組件的顯示位置
this.setBackground(Color.green); //組件的背景顏色
this.setLayout(new FlowLayout()); //容器為流布局,居中
this.add(new Label("姓名")); //標簽,添加到框架上
this.add(new TextField("卓摸卟透",20)); //文本行,20列
this.add(new Label("性別"));
this.add(new TextField("男",20));
this.add(new Label("籍貫"));
this.add(new TextField("召喚師峽谷",20));
this.add(new Label("班級"));
this.add(new TextField("RNG",20));
this.add(new Label("興趣"));
this.add(new TextField("打遊戲",20));
this.add(new Button("確認")); //創建按鈕
this.add(new Button("返回"));
this.setVisible(true); //顯示框架窗口,必須在添加組件後
}
public static void main (String arg[]){ new 個人信息();}
}

個人信息顯示