Java窗口设计课设,运行显示没有错误,出来是一个空白弹窗

package Owt;import java.awt.GridLayout;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.awt.event.ItemEvent;import java.awt.event.ItemListener;import javax.swing.ButtonGroup;import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JRadioButton;import javax.swing.JTextField;public class EventListener1 extends JFrame{ private static final long serialVersionUID = 1L; static final String EXIT_ON_CLOSE = null; public JLabel jlQuestion1;//题目标题 public JLabel jlQuestion2;//题目内容 public JLabel jlAnswer;//答案标题 public JLabel jlW;//题号 public JLabel jlT;//正确数 public JButton jbStart;//开始游戏 public JButton jbEnd;//停止游戏 public JButton jbExit;// 退出游戏 public JTextField jtfAnswer;//输入答案 public int m,n,l,answer,trueAnswer,x;//随机数m、n,计数参数 public static int y=6; public int a=0; public int b=0; public JRadioButton radioButton1 ; public JRadioButton radioButton2 ; public JRadioButton radioButton3 ; public JRadioButton radioButton4 ; public JRadioButton radioButton5 ; public JRadioButton radioButton6 ; public ButtonGroup group1; public ButtonGroup group2; public void JFrame() //构造函数 ,设计面板 { this.radioButton1=new JRadioButton("加法运算 +"); radioButton1.addActionListener((ActionListener) this); this.radioButton2=new JRadioButton("减法运算 -"); radioButton2.addItemListener((ItemListener) this); this.radioButton3=new JRadioButton("乘法运算 *"); radioButton3.addItemListener((ItemListener) this); this.radioButton4=new JRadioButton("除法运算 /"); radioButton4.addItemListener((ItemListener) this); this.group1=new ButtonGroup(); group1.add(radioButton1); group1.add(radioButton2); group1.add(radioButton3); group1.add(radioButton4); radioButton1.addItemListener((ItemListener) this); radioButton2.addItemListener((ItemListener) this); radioButton3.addItemListener((ItemListener) this); radioButton4.addItemListener((ItemListener) this); this.radioButton5=new JRadioButton("10以内的运算 "); this.radioButton6=new JRadioButton("100以内的运算 "); this.group2=new ButtonGroup(); group2.add(radioButton5); group2.add(radioButton6); radioButton5.addItemListener((ItemListener) this); radioButton6.addItemListener((ItemListener) this); this.x=0;//参数初始化 this.trueAnswer=0; this.setTitle("小学生算术运算测试软件 ");// 控件初始化 this.setLayout(new GridLayout(4,6));//7 行 2 列布局 this.jlQuestion1=new JLabel(); jlQuestion1.setText("题目: "); this.jlQuestion2=new JLabel(); this.jlAnswer=new JLabel(); jlAnswer.setText("答案: "); //ImageIcon icon=new ImageIcon("QQ图片大兵 .png"); this.jbStart=new JButton("开始测试 "); jbStart.addActionListener((ActionListener) this);//添加事件监听器 this.jbEnd=new JButton("完成测试 "); jbEnd.setEnabled(false);//开始时不可用 jbEnd.addActionListener((ActionListener) this);//添加事件监听器 this.jbExit=new JButton("退出游戏 "); jbExit.addActionListener((ActionListener) this);// 添加事件监听器 this.jtfAnswer=new JTextField(); jlW=new JLabel(); jlW.setText("题号: "+x); jlT=new JLabel(); jlT.setText("正确提交: "+trueAnswer); //控件第一行 this.add(new JLabel("请选择运算符: ")); this.add(radioButton1); this.add(radioButton2); this.add(radioButton3); this.add(radioButton4); //控件第二行 this.add(new JLabel("请选择运算范围: ")); this.add(radioButton5); this.add(new JLabel()); this.add(new JLabel()); this.add(radioButton6); //控件第三行 this.add(jlW);//添加控件 题号 1 this.add(jlT);//正确数 2 this.add(new JLabel()); this.add(jlQuestion1);//题目标题 2 this.add(jlQuestion2);//题目内容 3 //控件第四行 this.add(jbStart);//开始游戏 this.add(jbEnd);//停止游戏 this.add(jbExit);//退出游戏 this.add(jlAnswer);//答案标题 4 this.add(jtfAnswer);//输入答案 5 } private void add(JTextField jtfAnswer2) { } protected void add(JButton jbStart2) { } protected void add(JRadioButton radioButton22) { } protected void add(JLabel jLabel) { } protected void setLayout(GridLayout gridLayout) { } public void setTitle(String string) { } public void creatQuestion1()//新建题目 ,10 以内加法 { this.m=(int)(Math.random()*11);// 随机运算数 this.n=(int)(Math.random()*11); answer=m+n;//加法结果 this.jlQuestion2.setText(m+""+"+"+n+"=?");// 使label显示题目内 } public void creatQuestion2() //新建题目 ,10 以内减法 { this.m=(int)(Math.random()*11);// 随机运算数 this.n=(int)(Math.random()*11); answer=m-n; //减法结果 this.jlQuestion2.setText(m+""+"-"+n+"=?");// 使label显示题目内容 } public void creatQuestion3()//新建题目 ,10 以内乘法 { this.m=(int)(Math.random()*11);// 随机运算数 this.n=(int)(Math.random()*11); answer=m*n;//乘法结果 this.jlQuestion2.setText(m+""+"*"+n+"=?");// 使label显示题目内容 } public void creatQuestion4() {//新建题目 ,10 以内除法 this.m=(int)(Math.random()*11);// 随机运算数 this.n=(int)(Math.random()*11); answer=(int)(m/n);//除法结果 this.jlQuestion2.setText(m+""+"/"+n+"=?");// 使label显示题目内容 } public void creatQuestion5() {//新建题目 ,100 以内加法 this.m=(int)(Math.random()*101);// 随机运算数 this.n=(int)(Math.random()*101); answer=m+n;//加法结果 this.jlQuestion2.setText(m+""+"+"+n+"=?");// 使label显示题目内容 } publ

 

内容出不来一般都是布局问题,先检查下容器添加组件是否正确