-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A custom double textfield #1341
Comments
You can use a TextFormatter .
You probably have to specify a double value for it. Maybe use something as dummy value e.g. Double.NaN
You can override the NumberStringConverter Minimal example code: val textField = TextField()
textField.textFormatter = ...
val doubleProperty = SimpleDoubleProperty(0.0)
val converter = ...
Bindings.bindBidirectional(textField.textProperty(), doubleProperty, converter) |
val doubleProperty = doubleProperty(0.0)
textfield(doubleProperty).validator {
if (it?.toDoubleOrNull() == null) error("Not correct Double Number")
else success() // or null
} |
Hey, i'm new to JavaFX and TornadoFX so i have some questions:
I want to make a double only textfield and bind it to a double property and i want to know how to:
The text was updated successfully, but these errors were encountered: