java程序问题求助,急!!!在线等!!!
publicclassTetrisGameextendsJFrame{publicfinalstaticintPER_LINE_SCORE=100;publicfinal...
public class TetrisGame extends JFrame {
public final static int PER_LINE_SCORE = 100;
public final static int PER_LEVEL_SCORE = PER_LINE_SCORE * 10;
public final static int MAX_LEVEL = 10;
public final static int DEFAULT_LEVEL = 0;
private WindowPlay mywindow;
private Tetris block;
private boolean playing = false;
private Control ctrlPanel;
//建立菜单
private JMenuBar bar = new JMenuBar();
private JMenu mdifficulty=new JMenu("选择级别");
public void diff(){
ButtonGroup bg=new ButtonGroup();
JRadioButton zero;
zero=new JRadioButton("0级,方块下落速度为1.3秒", true);
zero.addActionListener(this);//不知道为什么这个地方总是报错“The method addActionListener(ActionListener) in the type AbstractButton is not applicable for the arguments (TetrisGame) ”
}
}
问题出在函数diff中,详细问题在注释上有。
请高手帮帮忙吧!!!只要能真正解决问题一定给分!!! 展开
public final static int PER_LINE_SCORE = 100;
public final static int PER_LEVEL_SCORE = PER_LINE_SCORE * 10;
public final static int MAX_LEVEL = 10;
public final static int DEFAULT_LEVEL = 0;
private WindowPlay mywindow;
private Tetris block;
private boolean playing = false;
private Control ctrlPanel;
//建立菜单
private JMenuBar bar = new JMenuBar();
private JMenu mdifficulty=new JMenu("选择级别");
public void diff(){
ButtonGroup bg=new ButtonGroup();
JRadioButton zero;
zero=new JRadioButton("0级,方块下落速度为1.3秒", true);
zero.addActionListener(this);//不知道为什么这个地方总是报错“The method addActionListener(ActionListener) in the type AbstractButton is not applicable for the arguments (TetrisGame) ”
}
}
问题出在函数diff中,详细问题在注释上有。
请高手帮帮忙吧!!!只要能真正解决问题一定给分!!! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询