Tutorial by Examples

TextInputDialog allows the to ask the user to input a single String. TextInputDialog dialog = new TextInputDialog("42"); dialog.setHeaderText("Input your favourite int."); dialog.setTitle("Favourite number?"); dialog.setContentText("Your favourite int: ");...
ChoiceDialog allows the user to pick one item from a list of options. List<String> options = new ArrayList<>(); options.add("42"); options.add("9"); options.add("467829"); options.add("Other"); ChoiceDialog<String> dialog = new Choice...
Alert is a simple popup that displays a set of buttons and gets an result depending on the button the user clicked: Example This lets the user decide, if (s)he really wants to close the primary stage: @Override public void start(Stage primaryStage) { Scene scene = new Scene(new Group(), 100...
The text displayed in a button can be customized, by creating a ButtonType instance yourself: ButtonType answer = new ButtonType("42"); ButtonType somethingElse = new ButtonType("54"); Alert alert = new Alert(Alert.AlertType.NONE, "What do you get when you multiply six ...

Page 1 of 1