Example usage for javafx.scene.control ChoiceBox setItems

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

Introduction

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

Prototype

public final void setItems(ObservableList<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);

    VBox box = new VBox();
    box.getChildren().add(choiceBox);//from w w  w  .  j av a2 s. co  m
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    ChoiceBox<String> choiceBox = new ChoiceBox<String>();
    choiceBox.setItems(cursors);

    choiceBox.show();//from w  w  w. j a  v  a 2s  .  c om

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

From source file:Main.java

@Override
public void start(Stage stage) {
    ChoiceBox<String> choiceBox = new ChoiceBox<String>();
    choiceBox.setItems(cursors);

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

    VBox box = new VBox();
    box.getChildren().add(choiceBox);/*from w w w.  ja v  a 2  s. co m*/
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    ChoiceBox<String> choiceBox = new ChoiceBox<String>();
    choiceBox.setItems(cursors);

    choiceBox.setValue("a");

    VBox box = new VBox();
    box.getChildren().add(choiceBox);//from   ww w .j  ava 2  s  . co m
    final Scene scene = new Scene(box, 300, 250);
    scene.setFill(null);
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    ChoiceBox<String> choiceBox = new ChoiceBox<String>();
    choiceBox.setItems(cursors);

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

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

From source file:Main.java

@Override
public void start(Stage stage) {
    ChoiceBox<String> choiceBox = new ChoiceBox<String>();
    choiceBox.setItems(cursors);

    SingleSelectionModel ssm = choiceBox.getSelectionModel();
    choiceBox.setSelectionModel(ssm);/*from  w  w w.j a v  a  2  s.co m*/

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