运行时,遇到了一个奇怪的问题
package tushu;import java.awt.GridLayout;
import java.awt.event.ActionListener;
import java.util.*;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
public class Student extends JFrame implements ActionListener {
private JLabel[] jb ={ new JLabel("学号"), new JLabel("姓名"),
new JLabel("性别"), new JLabel("班级"),
new JLabel("借书权限"), new JLabel("院系"),
new JLabel("密码")
};
private JTextField[] jf ={ new JTextField(), new JTextField(),
new JTextField(), new JTextField(), new JTextField()
};
private JPasswordField jpw = new JPasswordField();
private String[] str ={"是", "否" };
private JComboBox jcb = new JComboBox(str);
private JButton[] jbt = { new JButton("添加学生信息"), new JButton("删除学生信息"),
new JButton("修改学生信息"), new JButton("查询学生信息")
};
private Vector<String> v_head = new Vector<String>();
{ v_head.add("学号"); v_head.add("姓名"); v_head.add("性别");
v_head.add("班级"); v_head.add("院系"); v_head.add("密码");
v_head.add("借书权限");
}
private Vector<Vector> v_data = new Vector<Vector>();
DefaultTableModel dt = new DefaultTableModel(v_data, v_head);
private JTable jt = new JTable(dt);
private JPanel jp = new JPanel();
private JScrollPane jsp;
private JSplitPane jspl = new JSplitPane(JSplitPane.VERTICAL_SPLIT , true);
public Student() {
this.setLayout(new GridLayout(1,1));
jp.setLayout(null);
jb[0].setBounds(20, 10, 50, 30);
jp.add(jb[0]);
jf[0].setBounds(100, 10, 150, 30);
jp.add(jf[0]); jf[0].addActionListener(this);
jb[1].setBounds(280, 10, 50, 30);
jp.add(jb[1]);
jf[1].setBounds(360, 10, 150, 30);
jp.add(jf[1]); jf[1].addActionListener(this);
jb[2].setBounds(540, 10, 50, 30);
jp.add(jb[2]);
jf[2].setBounds(620, 10, 150, 30);
jp.add(jf[2]); jf[2].addActionListener(this);
jb[3].setBounds(800, 10, 100, 30);
jp.add(jb[3]);
jcb.setBounds(930, 10, 100, 30);
jp.add(jcb);
jcb.addActionListener(this);
jb[4].setBounds(20, 60, 50, 30);
jp.add(jb[4]);
jf[3].setBounds(100, 60, 150, 30);
jp.add(jf[3]); jf[3].addActionListener(this);
jb[5].setBounds(280, 60, 50, 30);
jp.add(jb[5]);
jf[4].setBounds(360, 60, 150, 30);
jp.add(jf[4]); jf[4].addActionListener(this);
jb[6].setBounds(540, 60, 50, 30);
jp.add(jb[6]);
jpw.setBounds(620, 60, 150, 30);
jp.add(jpw); jpw.addActionListener(this);
for(int i=0; i<jbt.length; i++) {
jbt[i].setBounds(100+210*i, 80, 200, 30);
jp.add(jbt[i]);
jbt[i].addActionListener(this);
}
jsp = new JScrollPane(jt);
jspl.setTopComponent(jp);
jspl.setBottomComponent(jsp);
jspl.setDividerLocation(100);
jspl.setDividerSize(4);
this.add(jspl);
this.setBounds(10, 10, 900, 500);
this.setVisible(true);
}
public void actionPerformed() {
}
public static void main(String[] args) {
new Student();
}
}
出现了下面的问题,求解惑!!!
Error occurred during initialization of VM
Could not reserve enough space for object heap