无法循环播放主菜单

时间:2019-07-17 02:45:14

标签: java swing

如何在Netbeans中循环“主菜单”?

int choice , fili, math, social, PE , pract, progr, ave1, fu = 300, mu = 500, su = 300, peu = 300, pru = 500, ramu = 500;

String str, name;
name = JOptionPane.showInputDialog("Enter name");
JOptionPane.showMessageDialog(null, "Hello " + name);
JOptionPane.showMessageDialog(null, "Proceed to next");
str = JOptionPane.showInputDialog("Subject \n" + "1. Filipino \n" +  "2. Math \n" + "3. Social Science \n" + "4. PE1 \n" + "5. Practical Research  \n" + "6. Programming \n" + "\n");
choice = Integer.parseInt(str);

if(choice ==1)
{
    str = JOptionPane.showInputDialog("Enter Number of Unit in Filipino: " );
    fili = Integer.parseInt(str);

    JOptionPane.showMessageDialog(null, "Total Amount: " + (fili * fu));
    str = JOptionPane.showInputDialog("Subject \n" + "1. Filipino \n" +  "2. Math \n" + "3. Social Science \n" + "4. PE1 \n" + "5. Practical Research  \n" + "6. Programming \n" + "\n");
    choice = Integer.parseInt(str);
}

0 个答案:

没有答案