Java(個人信息顯示界面)


package 個人信息;
import java.awt.*;
public class 秋池 extends Frame
{
 public 秋池()       //導入AWT包
{
 super("我的信息");           //窗口標題
    this.setSize(280,300);    //組件尺寸
    this.setLocation(300, 240);  //組件的顯示位置
    this.setBackground(Color.gray);  //組件的背景顏色
    this.setLayout(new FlowLayout());   //容器為流布局,居中
    this.add(new Label("姓名"));          //標簽,添加到框架上
    this.add(new TextField("奈何",20));   //文本行,20列
    this.add(new Label("學號"));
    this.add(new TextField("20163311105",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("計算機科學與技術(師范班)",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 秋池();}
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM