Double has
parseDouble method which tries to parse a String as a Double. You need to put it inside a try-catch block since it throws
NumberFormatException.
You can write logic inside catch since it is called if the value is not a valid double!
Here is an example code:
double value;
try {
// String textValue = the string from your JTextField
value = Double.parseDouble(textValue);
// if the code gets to here, it was recognizable as a double
}
catch(NumberFormatException e) {
// if the code gets to here, it was NOT recognizable as a double
}