Example usage for javafx.scene.control ChoiceBox ChoiceBox

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

Introduction

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

Prototype

public ChoiceBox(ObservableList<T> items) 

Source Link

Document

Create a new ChoiceBox with the given set of items.

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    ChoiceBox choiceBox = new ChoiceBox(cursors);

    System.out.println(choiceBox.getSelectionModel());
    VBox box = new VBox();
    box.getChildren().add(choiceBox);//from   w  w w  .ja v a  2s . 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 choiceBox = new ChoiceBox(cursors);

    System.out.println(choiceBox.converterProperty());
    VBox box = new VBox();
    box.getChildren().add(choiceBox);/*from w  w w .  j  ava  2 s  .c o 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 choiceBox = new ChoiceBox(cursors);

    System.out.println(choiceBox.getItems());
    VBox box = new VBox();
    box.getChildren().add(choiceBox);//ww  w  .  java 2  s  .  c  o  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 choiceBox = new ChoiceBox(cursors);

    System.out.println(choiceBox.getConverter());
    VBox box = new VBox();
    box.getChildren().add(choiceBox);/*  w ww . ja va2  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>(cursors);

    System.out.println(choiceBox.itemsProperty());
    VBox box = new VBox();
    box.getChildren().add(choiceBox);/*  ww w . j  a  v  a2s.  c  o  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>(cursors);

    System.out.println(choiceBox.selectionModelProperty());
    VBox box = new VBox();
    box.getChildren().add(choiceBox);//  w  ww.  j  a 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>(cursors);

    System.out.println(choiceBox.getValue());
    VBox box = new VBox();
    box.getChildren().add(choiceBox);//from  w w w  . j  a va 2  s .  c  o  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>(cursors);

    choiceBox.hide();/*from  www .  ja v  a  2  s.  c o 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();
}

From source file:Main.java

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

    System.out.println(choiceBox.isShowing());
    VBox box = new VBox();
    box.getChildren().add(choiceBox);/*w w w  . j a v a 2s .  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>(cursors);

    StringConverter sc = new NumberStringConverter();

    choiceBox.setConverter(sc);/*w  ww.j  a va2 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();
}