java 代码问题 !急求帮助!!!续上

来源:百度知道 编辑:UC知道 时间:2024/06/10 21:51:14
private void changeColor(JButton bt)
{
if(bt.getBackground()==default_color)
{
bt.setBackground(Color.GREEN);
}
else
bt.setBackground(default_color);
}

private void isOK()
{
int num=0;
for(int i=0;i<25;i++)
{
if(win_button[i].getBackground()==Color.GREEN)
num++;
}
if(num==25)
JOptionPane.showMessageDialog(null,"Congratulations!!!");
}
//重新开始按钮的监听器
class Reset implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
for(int i=0;i<25;i++)
{
win_panel.win_button[i].setBackground(default_color);
}
}
}
}
//==================OpenWindowViewer.java============
public class OpenWindowViewer
{
public static void main(Sring[] args)
{
new WindowsFrame(“开窗游戏”);
}
}

是不是
if(win_button[i].getBackground()==Color.GREEN) 和if(bt.getBackground()==default_color) 的问题啊??

应该不是吧?
而且num永远不可能超过>=25,你好好看看吧。

qq:412475540