/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package editablecomboboxtest; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.scene.layout.HBox; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import javafx.stage.Stage; /** * * @author GS8gi3 */ public class EditableComboBoxTest extends Application { /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) { primaryStage.setTitle("Hello World!"); Label l = new Label("label"); ComboBox c = new ComboBox(); c.setEditable(true); Button b = new Button(); b.setText("button"); HBox hbox = new HBox(); hbox.getChildren().addAll(l, c, b); ScrollPane scp = new ScrollPane(); scp.setContent(hbox); //If you remove this commentout, ComboBox will work normally. //scp.prefWidthProperty().bind(primaryStage.widthProperty()); Group g = new Group(scp); primaryStage.setScene(new Scene(g, 300, 250)); primaryStage.show(); } }