Class ChoiceDialog<T>

java.lang.Object
javafx.scene.control.Dialog<T>
javafx.scene.control.ChoiceDialog<T>
Type Parameters:
T - The type of the items to show to the user, and the type that is returned via Dialog.getResult() when the dialog is dismissed.
All Implemented Interfaces:
EventTarget

public class ChoiceDialog<T> extends Dialog<T>
A dialog that shows a list of choices to the user, from which they can pick one item at most.

Example:

 List<String> colors = List.of("Red", "Yellow", "Green");
 ChoiceDialog choiceDialog = new ChoiceDialog<>("Yellow", colors);
 choiceDialog.showAndWait();
Image of the ChoiceDialog control
Since:
JavaFX 8u40
See Also: