I got something like this in mi fxml file:
<TextField fx:id="id" onInputMethodTextChanged="#foo" prefWidth="200.0" promptText="" />
But when I run it, I TAB or mouse out of the TextField control and nothing happens ("foo" isn't called) .
The onInputMethodTextChanged
property of TextField
is applicable only if the ConditionalFeature.INPUT_METHOD
is supported by the platform. To check this try
Platform.isSupported(ConditionalFeature.INPUT_METHOD)
If you are trying to do some work when the user focuses out from textfield, try
textField.focusedProperty().addListener(new ChangeListener<Boolean>() {
@Override
public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
if(!newValue) {
System.out.println("Focusing out from textfield");
}
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With