Editable ComboBox bug ?
omathe at free.fr
omathe at free.fr
Mon Sep 1 13:55:59 UTC 2014
Hi,
I have reproduce in a small example a ComBox behavior which I suspect to be a bug.
When the TextField intercepts the event, the println displays the current value => OK
When the ComboBox (which is an editable one) intercept the event the println does not display the current value => bug ?
@Override
public void start(Stage primaryStage) {
TextField textField = new TextField();
ComboBox comboBox = new ComboBox();
comboBox.setEditable(true);
EventHandler eventHandler = (Event e) -> {
System.out.println("textField textValue : " + textField.textProperty().get());
System.out.println("comboBox value : " + comboBox.valueProperty().get());
};
textField.addEventFilter(KeyEvent.KEY_RELEASED, eventHandler);
comboBox.addEventFilter(KeyEvent.KEY_RELEASED, eventHandler);
StackPane root = new StackPane();
VBox vBox = new VBox(textField, comboBox);
root.getChildren().addAll(vBox);
Scene scene = new Scene(root, 300, 250);
primaryStage.setScene(scene);
primaryStage.show();
}
Could you please confirm if it is a bug ?
Thanks
Olivier
More information about the openjfx-dev
mailing list