package javafxapplication4; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.ChoiceBox; import javafx.scene.layout.StackPane; import javafx.stage.Stage; /** * * @author Alexander */ public class JavaFXApplication4 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!"); ChoiceBox box = new ChoiceBox(); box.setPrefWidth(250); StackPane root = new StackPane(); root.getChildren().add(box); primaryStage.setScene(new Scene(root, 300, 250)); primaryStage.show(); } }