Example usage for javafx.scene.control ChoiceBox valueProperty

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

Introduction

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

Prototype

public ObjectProperty<T> valueProperty() 

Source Link

Document

The value of this ChoiceBox is defined as the selected item in the ChoiceBox selection model.

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    ChoiceBox<String> choiceBox = new ChoiceBox<String>();
    choiceBox.setItems(cursors);//from   w  w  w.ja  va2s . c o m

    System.out.println(choiceBox.valueProperty());

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