设置了窗体大小却显示不出
import java.awt.Button;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.WindowConstants;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;
public class yewuyuan extends JFrame implements ActionListener, AncestorListener{
private JFrame yewuyuanFrame;
private JPanel panel,panel1,panel2,panel3,panel11,panel12,panel13,panel14,panel15,panel21,panel22,panel23
,panel24,panel31,panel32,panel33,panel34,panel35,panel36,panel37;
private JTabbedPane ywytabbedPane;
private JButton //dengjiButton,kaihaoButton,cunqukuanButton,
qdButton1,qdButton2,qdButton3,czButton1,czButton2,czButton3;
private JLabel xmLabel,sfzhLabel1,sfzhLabel2,
dzLabel,dhhmLabel,zhLabel,mmLabel,
rqLabel1,rqLabel2,khdzhLabel1,khdzhLabel2,
ywyhLabel1,ywyhLabel2,ckjeLabel,qkjeLabel,yeLabel;
private JTextField xmField,sfzhField1,sfzhField2,dzField,dhhmField,zhField,
mmField,ckjeField,qkjeField,yeField;
public yewuyuan(){
yewuyuanFrame=new JFrame("业务员");
yewuyuanFrame.setSize(500, 600);
yewuyuanFrame.setLocationRelativeTo(yewuyuanFrame.getOwner());//居中屏幕显示
yewuyuanFrame.setDefaultCloseOperation(yewuyuanFrame.EXIT_ON_CLOSE);
yewuyuanFrame.setVisible(false);
panel1=new JPanel(new GridLayout(4,1));
panel2=new JPanel(new GridLayout(4,1));
panel3=new JPanel(new GridLayout(7,1));
panel11=new JPanel();
panel12=new JPanel();
panel13=new JPanel();
panel14=new JPanel();
panel15=new JPanel();
panel21=new JPanel();
panel22=new JPanel();
panel23=new JPanel();
panel24=new JPanel();
panel31=new JPanel();
panel32=new JPanel();
panel33=new JPanel();
panel34=new JPanel();
panel35=new JPanel();
panel36=new JPanel();
panel37=new JPanel();
panel=new JPanel();
yewuyuanFrame.add(panel);
ywytabbedPane=new JTabbedPane();
panel.add(ywytabbedPane);
// dengjiButton=new JButton("客户登记");
// kaihaoButton=new JButton("客户开号");
// cunqukuanButton=new JButton("客户存取款");
ywytabbedPane.addTab("客户登记",panel1);
ywytabbedPane.addTab("客户开号", panel2);
ywytabbedPane.addTab("客户存取款", panel3);
panel1.addAncestorListener(this);
panel2.addAncestorListener(this);
panel3.addAncestorListener(this);
panel1.add(panel11);
panel1.add(panel12);
panel1.add(panel13);
panel1.add(panel14);
panel2.add(panel21);
panel2.add(panel22);
panel2.add(panel23);
panel2.add(panel24);
panel3.add(panel31);
panel3.add(panel32);
panel3.add(panel33);
panel3.add(panel34);
panel3.add(panel35);
panel3.add(panel36);
panel3.add(panel37);
// 一
xmLabel=new JLabel("姓名:");
sfzhLabel1=new JLabel("身份证号:");
dzLabel=new JLabel("住址:");
dhhmLabel=new JLabel("电话号码:");
xmField=new JTextField();
xmField.setSize(50,50);
sfzhField1=new JTextField();
dzField=new JTextField();
dhhmField=new JTextField();
qdButton1=new JButton("确定");
qdButton1.addActionListener(this);
czButton1=new JButton("重置");
czButton1.addActionListener(this);
panel11.add(xmLabel);
panel11.add(xmField);
panel12.add(sfzhLabel1);
panel12.add(sfzhField1);
panel13.add(dzLabel);
panel13.add(dzField);
panel14.add(dhhmLabel);
panel14.add(dhhmField);
panel15.add(qdButton1);
panel15.add(czButton1);
// 二
sfzhLabel2=new JLabel("身份证号:");
zhLabel=new JLabel("账号:");
mmLabel=new JLabel("密码:");
sfzhField2=new JTextField();
zhField=new JTextField();
mmField=new JTextField();
qdButton2=new JButton("确定");
qdButton2.addActionListener(this);
czButton2=new JButton("重置");
czButton2.addActionListener(this);
panel21.add(sfzhLabel2);
panel21.add(sfzhField2);
panel22.add(zhLabel);
panel22.add(zhField);
panel23.add(mmLabel);
panel23.add(mmField);
panel24.add(qdButton2);
panel24.add(czButton2);
// 三
rqLabel1=new JLabel("日期:");
rqLabel2=new JLabel();
ywyhLabel1=new JLabel("业务员号:");
ywyhLabel2=new JLabel();
khdzhLabel1=new JLabel("客户的账号:");
khdzhLabel2=new JLabel();
ckjeLabel=new JLabel("存款金额:");
qkjeLabel=new JLabel("取款金额");
yeLabel=new JLabel("余额:");
ckjeField=new JTextField();
qkjeField=new JTextField();
yeField=new JTextField();
qdButton3=new JButton("确定");
qdButton3.addActionListener(this);
czButton3=new JButton("重置");
czButton3.addActionListener(this);
panel31.add(rqLabel1);
panel31.add(rqLabel2);