While trying to clear the TextField of the JFXTimePicker I noticed that doing timePicker.getEditor().clear() didn't do anything.
I do:
@FXML
private JFXTimePicker timePicker;
and inside a method I call the method:
private void clearField()
{
timePicker.getEditor().clear();
}
Looking through the files of JFXTimePicker, I don't think getEditor() is implemented correctly. Neither do I know why it's there at all.
However, to set the value of the TextField one can simply use jfxTimePicker.setValue(new LocalTimeStringConverter().fromString("")).
Hello,
_getEditor()_ method will be updated later to fix this issue. Meanwhile, (as @Iw1s mentioned) you can simply call jfxTimePicker.setValue(new LocalTimeStringConverter().fromString("")) to clear the value.
Regards
Hello,
you can now clear the editor text by using one of the following:
jfxTimePicker.setValue(null); or jfxTimePicker.getEditor().clear();
please note that you need to use the latest jfoenix jar as we fixed some issues in pickers.
Regards,
Most helpful comment
Hello,
you can now clear the editor text by using one of the following:
jfxTimePicker.setValue(null);orjfxTimePicker.getEditor().clear();please note that you need to use the latest jfoenix jar as we fixed some issues in pickers.
Regards,