package exam.pengbozuishuai;
import java.awt.GridLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class SystemExam extends JFrame {
JTextField dormitory,number,name,sex,age,clas;
public SystemExam() {
this.setTitle("宿舍成员管理系统");
this.setSize(400, 400);
dormitory = new JTextField(6);
JPanel j1 = new JPanel();
JLabel j1Labe1 = new JLabel("宿舍号:");
j1.add(j1Labe1);
j1.add(dormitory);
number = new JTextField(6);
JPanel j2 = new JPanel();
JLabel j1Labe2 = new JLabel("学号:");
j2.add(j1Labe2);
j2.add(number);
name = new JTextField(6);
JPanel j3 = new JPanel();
JLabel j1Labe3 = new JLabel("姓名:");
j3.add(j1Labe3);
j3.add(name);
sex = new JTextField(6);
JPanel j4 = new JPanel();
JLabel j1Labe4 = new JLabel("性别:");
j4.add(j1Labe4);
j4.add(sex);
age = new JTextField(6);
JPanel j5 = new JPanel();
JLabel j1Labe5 = new JLabel("年龄:");
j5.add(j1Labe5);
j5.add(age);
JLabel j1Labe6 = new JLabel("班级:");
JPanel j6 = new JPanel();
clas = new JTextField(6);
j6.add(j1Labe6);
j6.add(dormitory);
this.setLayout(new GridLayout(8, 1));
this.add(j1);
this.add(j2);
this.add(j3);
this.add(j4);
this.add(j5);
this.add(j6);
this.setVisible(true);
}
public static void main(String[] args) {
new SystemExam();
}
}
为啥宿舍号后面没有文本框。。。。。