I have a JFormattedTextField with a NumberFormat with Locale.US. So the decimal separator is the point and the grouping separator is the comma.
JFormattedTextField
NumberFormat
I would suggest you to use regex and use the match fucntion like this:
matches("\\d+([.,])?")
Also if you will use Integer.parseInt(String) will throw an exception if it will be parsed or you can use Double.parseDouble(value)
Integer.parseInt(String)
Double.parseDouble(value)