data input error

I am having a strange error I never had before. My program gives me the NumberFormatException every time, the matter what I type in. It seems to be trying to parse the text in the println instead of the actual input, because when I told it to print out "5", instead of "Enter X coordinate of target", it worked. I have used a similar code in the past and it worked fine.

My code is this:

global variables:

static double xTarg= 0.0, yTarg= 0.0;

.

.

.

in main method:

BufferedReader BR = new BufferedReader(new InputStreamReader(System.in));

try {

System.out.println("Enter X coordinate of target");

xTarg = Double.parseDouble(BR.readLine());

System.out.println("Enter Y coordinate of target");

yTarg = Double.parseDouble(BR.readLine());

}

catch (NumberFormatException e)

{

System.out.println("NumberFormatException has happened");

System.exit(0);

}

catch (IOException e)

{

System.out.println("bad input");

System.exit(0);

}

[1074 byte] By [fuzzymillipedea] at [2007-11-26 22:28:45]
# 1
I tried using another IDE, and the program ran as I intended. There must be something wrong with my JCreator..
fuzzymillipedea at 2007-7-10 11:32:07 > top of Java-index,Java Essentials,Java Programming...
# 2
I ran your code using JCreator and it works fine. Did you use a comma ',' or a dot '.' for the decimal point? Because that seems to make a difference...#
duckbilla at 2007-7-10 11:32:08 > top of Java-index,Java Essentials,Java Programming...