Xtrme_XJ
11-10-2008, 01:41 AM
I'm sorry if this is a Trivial Question I have not done Java in forever and cannot for the life of me figure out what I am doing wrong... It may Very Well be that it is 1:35am...
I am not getting out of the loop even if I Press 1 or 2 or 3 or 4 or 5
String ans="";
do {
ans = JOptionPane.showInputDialog(null, "Choices are:\n(1) Add new employee\n(2) List employees\n" +
"(3) Display infomration about about an employee\n" +
"(4) Display average wage of employees\n(5) Quit\n\n" +
"What is your choice?\n");
if(!ans.equals("1")||!ans.equals("2")||!ans.equals("3")||!ans.equals("4")||!ans.equals("5"))
JOptionPane.showMessageDialog(null, "");
} while (!ans.equals("1")||!ans.equals("2")||!ans.equals("3")||!ans.equals("4")||!ans.equals("5"));
JOptionPane.showMessageDialog(null, "out");
Thanks for your understanding of my easy question...
I am not getting out of the loop even if I Press 1 or 2 or 3 or 4 or 5
String ans="";
do {
ans = JOptionPane.showInputDialog(null, "Choices are:\n(1) Add new employee\n(2) List employees\n" +
"(3) Display infomration about about an employee\n" +
"(4) Display average wage of employees\n(5) Quit\n\n" +
"What is your choice?\n");
if(!ans.equals("1")||!ans.equals("2")||!ans.equals("3")||!ans.equals("4")||!ans.equals("5"))
JOptionPane.showMessageDialog(null, "");
} while (!ans.equals("1")||!ans.equals("2")||!ans.equals("3")||!ans.equals("4")||!ans.equals("5"));
JOptionPane.showMessageDialog(null, "out");
Thanks for your understanding of my easy question...