Example usage for javafx.scene.control ChoiceBox setSelectionModel

List of usage examples for javafx.scene.control ChoiceBox setSelectionModel

Introduction

In this page you can find the example usage for javafx.scene.control ChoiceBox setSelectionModel.

Prototype

public final void setSelectionModel(SingleSelectionModel<T> value) 

Source Link

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    ChoiceBox<String> choiceBox = new ChoiceBox<String>();
    choiceBox.setItems(cursors);/*  w  ww  .j a  va 2s.  com*/

    SingleSelectionModel ssm = choiceBox.getSelectionModel();
    choiceBox.setSelectionModel(ssm);

    VBox box = new VBox();
    box.getChildren().add(choiceBox);
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);
    stage.setScene(scene);
    stage.show();
}