/* (C) 2011 */ package fxsqe; import com.sun.javafx.runtime.VersionInfo; import javafx.application.Application; import javafx.collections.FXCollections; import javafx.scene.Scene; import javafx.scene.control.ChoiceBox; import javafx.scene.control.ComboBox; import javafx.scene.layout.VBox; import javafx.stage.Stage; /** * * @author Sergey */ public class TestComboBox extends Application{ @Override public void start(Stage stage) throws Exception { VBox root = new VBox(5); Scene scene = new Scene(root, 300,300); stage.setScene(scene); String style = "-fx-border-color: red;-fx-border-insets: 5;"; ComboBox cb = new ComboBox(); cb.setItems(FXCollections.observableArrayList("one", "two", "three three")); cb.getSelectionModel().select(0); cb.setStyle(style); ChoiceBox cb2 = new ChoiceBox(); cb2.setItems(FXCollections.observableArrayList("one", "two", "three three")); cb2.getSelectionModel().select(0); cb2.setStyle(style); root.getChildren().addAll(cb, cb2); stage.show(); stage.setTitle(VersionInfo.getRuntimeVersion()); } public static void main(String[] args) { launch(args); } }