标签缺少错误蚀

时间:2015-07-13 13:09:32

标签: java continue

我有这个代码,基本上我的问题是我想要返回我的while循环。我第一次尝试继续但是它不起作用..

}
else
{
JOptionPane.showMessageDialog(null, "You Did Not Choose Between Keep Or Execute..Program Exiting","Error Nothing Chosed",JOptionPane.ERROR_MESSAGE);
                    continue test;
                }
            }else{
                JOptionPane.showMessageDialog(null,"An Error Occured, Please Restart The Game!","Winner Error",JOptionPane.ERROR_MESSAGE);
                Attack=false;
                MainMenu=true;
            }
        }
} }

我尝试使用下面的代码返回,但它不起作用。所以我的问题是如何使用continue语句或另一个语句来完成这项工作..谢谢

test: 
        {while(MainMenu){
    String M1=JOptionPane.showInputDialog(Name1+" you are starting first. Here are your options\n 1.Invade \n 2.Buy \n 3.Pass \n 4.Check Money Balance \n 5.Check Soldier Count \n 6.Citizen's Hapinness","Type the Number of the action you want to take place");
    if(M1.equals("1")){
        if(CityNum==1){
        JOptionPane.showInputDialog("You are Currently At The Veiled Atoll so you have the option to invade \n 1.Zicat Penishula \n 2.Flehst Archipelago \n 3.The Sharktooth Isle","Type the Number of the Island you want to Invade");
        String CurrentIsland="The Veiled Atoll";
        MainMenu=false;
        Attack=true;
        }

0 个答案:

没有答案