Skip to main content

help with a code

4 replies [Last post]
megalow
Offline
Joined: 2012-11-08
Points: 0

can anyone tell me where is the error on this code???

double x;
x = Double.parseDouble(JOptionPane.showInputDialog("qual resposta vc escolhe?"));
while(x=1) {
JOptionPane.showMessageDialog(null, "Moo Onii-chan no Baka Baka Baka ><", "esta foi uma resposta ruim...", 1);
}

the objective is to use a text window to give a value to X and with that value, choice an apropriate answer.
already tried with if and also didn't worked

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jocurios
Offline
Joined: 2012-11-23
Points: 0

Hi, i have same problem like "megalow". Nobody can help us with this?

Thanks,
Terry

megalow
Offline
Joined: 2012-11-08
Points: 0

jocurios, if your trouble is the same as mine then use this:
while(x == value)

megalow
Offline
Joined: 2012-11-08
Points: 0

jocurios, if your trouble is the same as mine then use this:
while(x == value)

megalow
Offline
Joined: 2012-11-08
Points: 0

error has been found:
since i'm using a double instead of a boolean
the "while" must be:
while(x==1)