Example usage for javafx.scene.control ButtonType CLOSE

List of usage examples for javafx.scene.control ButtonType CLOSE

Introduction

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

Prototype

ButtonType CLOSE

To view the source code for javafx.scene.control ButtonType CLOSE.

Click Source Link

Document

A pre-defined ButtonType that displays "Close" and has a ButtonData of ButtonData#CANCEL_CLOSE .

Usage

From source file:cz.afrosoft.whattoeat.cookbook.recipe.gui.dialog.RecipeViewDialog.java

private void setupButtons() {
    getDialogPane().getButtonTypes().add(ButtonType.CLOSE);
    DialogUtils.translateButtons(this);
}

From source file:jlotoprint.MainViewController.java

public static void loadAboutWindow() {

    //setup/*  w  w w  .  j a  v a  2  s  .  co  m*/
    Dialog dialog = new Dialog<>();
    dialog.getDialogPane().getButtonTypes().add(ButtonType.CLOSE);
    dialog.setTitle("About JLotoPanel");
    dialog.setHeaderText("JLotoPanel v1.0");
    ImageView icon = new ImageView("file:resources/icon.png");
    icon.setSmooth(true);
    icon.setFitHeight(48.0);
    icon.setFitWidth(48.0);
    dialog.setGraphic(icon);
    dialog.initModality(Modality.APPLICATION_MODAL);
    dialog.initOwner(JLotoPrint.stage.getScene().getWindow());
    //content
    GridPane grid = new GridPane();
    grid.setPadding(new Insets(10, 10, 0, 10));

    //text
    TextArea textArea = new TextArea("For more info, please visit: https://github.com/mbppower/JLotoPanel");
    textArea.setWrapText(true);
    grid.add(textArea, 0, 0);
    dialog.getDialogPane().setContent(grid);

    dialog.showAndWait();
}