Okay, i'm currently designing a GUI in JavaFX. i have a text box that needs to allow for doubles. It currently allows for doubles, but it allows the user to still add multiple decimals
what I want: 92.8123
what i don't want: 92..5.78
I've tried to fiddle around with it, but I don't understand regular expressions enough to limit the text box to what I want properly.
tpo.textProperty().addListener((observable, oldValue, newValue) -> {
if (!newValue.matches("\\d*")) tpo.setText(newValue.replaceAll("[^\\d.]", ""));
});
tpo is the name of the text box