JFXtras / jfxtras

A supporting library for JavaFX, containing helper classes, extended layouts, controls and other interesting widgets.
http://jfxtras.org
Other
599 stars 123 forks source link

LocalDateTimeTextField: Better handling of DateTimeParseException #88

Closed DJViking closed 6 years ago

DJViking commented 6 years ago

When a user manually enters an illegal datetime jfxtras will print out the DateTimeParseException stack trace. It will not crash the application, it just reverts to the previous datetime when focus leaves the LocalDateTimeTextField.

There should be a way for the application to handle this ParseException and make appropriate actions. At least prevent this stack trace to print out to console.

tbee commented 6 years ago

The textfield has a parseErrorCallbackObjectProperty, which can be used to handle parsing problems. If it is not set, the textfield will simply print the problem to stderr, as you described.

DJViking commented 6 years ago

Thanks. That is just what I needed.