按钮的触发我就不写了把布局给你贴出来
public class StudentSystem extends JFrame{
/**
*
*/
private static final long serialVersionUID = 1L;
JTabbedPane tabbedPane = new JTabbedPane();
JButton b1 = new JButton("Add Student");;
JButton b2 = new JButton("Store to File");;
JTextField t1 = new JTextField();;
JTextField t2 = new JTextField();;
JTextField t3 = new JTextField();;
JLabel l1 = new JLabel("Name:");;
JLabel l2 = new JLabel("No:");;
JLabel l3 = new JLabel("Gender:");
JLabel l4 = new JLabel("Tom 20100899 boy");
JLabel l5 = new JLabel("Rose 20100812 girl");
JLabel l6 = new JLabel("Mike 20100811 boy");
JPanel jp1=new JPanel();
StudentSystem(){
super("学生信息增加");
setLayout(null);
l1.setBounds(new Rectangle(200,2,100,25));
jp1.add(l1);
t1.setBounds(new Rectangle(250,2,100,25));
jp1.add(t1);
l2.setBounds(new Rectangle(200,52,100,25));
jp1.add(l2);
t2.setBounds(new Rectangle(250,52,100,25));
jp1.add(t2);
l3.setBounds(new Rectangle(200,102,100,25));
jp1.add(l3);
t3.setBounds(new Rectangle(250,102,100,25));
jp1.add(t3);
b1.setBounds(new Rectangle(180,320,150,25));
jp1.add(b1);
b2.setBounds(new Rectangle(330,320,150,25));
jp1.add(b2);
l4.setBounds(new Rectangle(130,172,800,25));
jp1.add(l4);
l5.setBounds(new Rectangle(130,192,800,25));
jp1.add(l5);
l6.setBounds(new Rectangle(130,212,800,25));
jp1.add(l6);
jp1.setBounds(20,2,500,500);
jp1.setLayout(null);
add(jp1);
setSize(600,400);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(String[] args) {
new StudentSystem();
}
}
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/ac6eddc451da81cb230f0bd15066d016082431c4?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)