import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.ComboBox; import javafx.scene.layout.VBox; import javafx.stage.Stage; /** * * @author Stanislav Smirnov */ public class ComboBoxTest extends Application { public static void main(String[] args) { launch(args); } @Override public void start(final Stage primaryStage) { ComboBox createObject = new ComboBox(); createObject.getItems().add("item1"); createObject.getItems().add("item2"); VBox vBox = new VBox(); vBox.setSpacing(50); vBox.getChildren().addAll(createObject); primaryStage.setScene(new Scene(vBox, 300, 200)); primaryStage.show(); } }