首页 > 其他 > 详细

实验十二

时间:2019-06-17 23:32:04      阅读:132      评论:0      收藏:0      [点我收藏+]

 

package ziwojieshao;
import java.awt.FlowLayout;
import javax.swing.*;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.*;

public class hello extends JFrame{
public hello()
{
JFrame test=new JFrame ("自我介绍");
test.setLayout(new GridLayout(0,2));
test.getContentPane().add(new JLabel("姓名")) ;
test.getContentPane().add(new JTextField("吴慧",12)) ;
test.getContentPane().add(new JLabel("性别")) ;

test.setSize(180,210);
test.getContentPane().add(new JTextField("女",12));
String proList[] = { "年龄","民族" ,"籍贯","学号","学院","专业"};
test.getContentPane().add(new JLabel(proList[0]));
test.getContentPane().add(new JTextField("21",2));
test.getContentPane().add(new JLabel(proList[1]));
test.getContentPane().add(new JTextField("汉族",8));
test.getContentPane().add(new JLabel(proList[2]));
test.getContentPane().add(new JTextField("海南",8));
test.getContentPane().add(new JLabel(proList[3]));
test.getContentPane().add(new JTextField("20173311101",12));
test.getContentPane().add(new JLabel(proList[4]));
test.getContentPane().add(new JTextField("计算机学院",12));
test.getContentPane().add(new JLabel(proList[5]));
test.getContentPane().add(new JTextField("网络工程",12));

test.setVisible(true);
}    
public static void main (String[] args) {
new hello();
}

}
技术分享图片

实验十二

原文:https://www.cnblogs.com/wuhui111/p/11042589.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!