I first open comboBox and found, that if I edited content of combo box and pressed enter, initial text (i mean, initially selected item) returned.
This issue can be dublicate ofRT-18179.
import com.javafx.preview.control.ComboBox;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
/**
* @author Alexander Kirov
*/
public class Issue1 extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
Pane pane = new Pane();
pane.setPrefHeight(200);
pane.setPrefWidth(200);
ComboBox cb = new ComboBox();
cb.setEditable(true);
cb.getItems().addAll("0000", "1111", "2222", "3333");
pane.getChildren().add(cb);
VBox vb = new VBox();
vb.getChildren().addAll(pane);
Scene scene = new Scene(vb, 400, 400);
stage.setScene(scene);
stage.show();
}
}
Steps to reproduce:
1. select any item from dropDown
2. try to edit content in comboBox.
3. press Enter.
(I don't know is it proper behavior or not, but saving editing result on enter is very intuitive)
This issue can be dublicate of
import com.javafx.preview.control.ComboBox;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
/**
* @author Alexander Kirov
*/
public class Issue1 extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
Pane pane = new Pane();
pane.setPrefHeight(200);
pane.setPrefWidth(200);
ComboBox cb = new ComboBox();
cb.setEditable(true);
cb.getItems().addAll("0000", "1111", "2222", "3333");
pane.getChildren().add(cb);
VBox vb = new VBox();
vb.getChildren().addAll(pane);
Scene scene = new Scene(vb, 400, 400);
stage.setScene(scene);
stage.show();
}
}
Steps to reproduce:
1. select any item from dropDown
2. try to edit content in comboBox.
3. press Enter.
(I don't know is it proper behavior or not, but saving editing result on enter is very intuitive)