当应用程序递归太深时抛出异常
package com.tsinghuasoftfive.java;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.LayoutManager;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class AddInterface extends JFrame {
// "姓名", "性别", "年龄", "籍贯", "电话号码", "QQ号码", "就业去向"
private static final long serialVersionUID=1L;
JPanel jp1 = new JPanel();
JPanel jp2 = new JPanel();
JPanel jp3 = new JPanel();
JPanel jp4 = new JPanel();
JPanel jp5 = new JPanel();
JPanel jp6 = new JPanel();
JPanel jp7 = new JPanel();
JPanel jp8 = new JPanel();
JLabel lb1 = new JLabel("姓名:");
JLabel lb2 = new JLabel("性别:");
JLabel lb3 = new JLabel("年龄:");
JLabel lb4 = new JLabel("籍贯:");
JLabel lb5 = new JLabel("电话:");
JLabel lb6 = new JLabel("QQ:");
JLabel lb7 = new JLabel("就业去向:");
JTextField tf1 = new JTextField(10);
JRadioButton rb1 = new JRadioButton("男");
JRadioButton rb2 = new JRadioButton("女");
JComboBox cb1 = new JComboBox();
JComboBox cb2 = new JComboBox();
JTextField tf2 = new JTextField(10);
JTextField tf3 = new JTextField(10);
JTextField tf4 = new JTextField(10);
JButton bt1 = new JButton("提 交");
JButton bt2 = new JButton("取 消");
Icon img=new ImageIcon("Pic\\welcome.gif");
public AddInterface() {
layout();
}
public void layout() {
this.setTitle("软五班添加成员");
this.setSize(280, 400);
this.setLayout(new GridLayout(7,1));
JLabel image=new JLabel(img);
jp1.setLayout(new BorderLayout());
jp1.add(image,"Center");
jp2.add(lb1);
jp2.add(tf1);
jp3.add(lb2);
jp3.add(rb1);
jp3.add(rb2);
jp4.add(lb3);
jp4.add(cb1);
jp5.add(lb4);
jp5.add(cb2);
jp6.add(lb5);
jp6.add(tf2);
jp7.add(lb6);
jp7.add(tf3);
jp8.add(bt1);
jp8.add(bt2);
this.add(jp1,"North");
this.add(jp2);
this.add(jp3);
this.add(jp4);
this.add(jp5);
this.add(jp6);
this.add(jp7);
this.add(jp8);
this.setLocationRelativeTo(null);
this.setVisible(true);
}
}
就这么一目了然的代码,居然报错???