请各位前辈帮忙看看,我的程序为什么不显添的所有组件,谢谢!
请各位前辈帮忙看看,我的程序为什么不显添的所有组件,谢谢!import java.awt.*;
import javax.swing.*;
public class text12 {
public static void main(String[] args){
JFrame f=new JFrame("任务二");
f.setLocation(100,100);
f.setSize(600,1000);
JPanel fr=new JPanel();//面板1
fr.setLocation(200,100);
fr.setSize(100,100);
f.getContentPane().add(fr);
JLabel a=new JLabel("学号");
JTextField b=new JTextField(10);
fr.add(a);
fr.add(b);
fr.setLayout(new FlowLayout(FlowLayout.CENTER));
JPanel fn=new JPanel();//面板2
fn.setLocation(200,300);
fn.setSize(100,100);
f.getContentPane().add(fn);
JLabel c=new JLabel("姓名");
JTextField d=new JTextField(10);
fn.add(c);
fn.add(d);
fn.setLayout(new FlowLayout(FlowLayout.CENTER));
JPanel fm=new JPanel();//面板3
fm.setLocation(200,500);
fm.setSize(100,100);
JLabel e=new JLabel("性别");
JRadioButton j=new JRadioButton("男");
JRadioButton h=new JRadioButton("女");
JCheckBox m=new JCheckBox("团员");
fm.add(e);
fm.add(j);
fm.add(h);
fm.add(m);
fm.setLayout(new FlowLayout(FlowLayout.CENTER));
JPanel fj=new JPanel();//面板4
fr.setLocation(200,800);
fr.setSize(100,100);
JLabel x=new JLabel("班级");
JTextField y=new JTextField(10);
fj.add(x);
fj.add(y);
fj.setLayout(new FlowLayout(FlowLayout.CENTER));
JPanel fh=new JPanel();//面板5
fr.setLocation(200,900);
fr.setSize(100,100);
JLabel i=new JLabel("简介");
JTextArea p=new JTextArea(3,10);
fh.add(i);
fh.add(p);
fh.setLayout(new FlowLayout(FlowLayout.CENTER));
// f.add(new Button("确定"));
f.setLayout(new FlowLayout(FlowLayout.CENTER));
f.setVisible(true);
}
}