Skip to content
Snippets Groups Projects
Select Git revision
  • 8e269d0c075e4b762041391b26f6b5f0b4d59cb6
  • master default
  • renovate/opencsv.version
  • renovate/org.springframework.boot-spring-boot-starter-parent-3.x
  • renovate/testcontainer.version
  • renovate/junit-jupiter-engine.version
  • renovate/jgit.version
  • renovate/selenium.version
  • renovate/datatables.version
  • renovate/jacoco-maven-plugin.version
  • renovate/org.apache.maven.plugins-maven-surefire-plugin-3.x
  • demo
  • v1_8_1
  • v2.18.0
  • v2.17.2
  • v2.17.1
  • v2.17.0
  • v2.16.1
  • v2.16.0
  • v2.15.1
  • v2.15.0
  • v2.14.0
  • v2.13.0
  • v2.12.0
  • v2.11.0
  • v2.10.0
  • v2.9.2
  • v2.9.1
  • v2.9.0
  • v2.8.0
  • testPipeline2
  • v2.7.0
  • v2.6.1
33 results

base_en.properties

Blame
  • AlertGenerator.java 1.16 KiB
    package de.brickedleveleditor.utils;
    
    import javafx.scene.control.Alert;
    import javafx.scene.control.Alert.AlertType;
    import javafx.scene.image.Image;
    import javafx.stage.Stage;
    
    public class AlertGenerator
    {
        public static void showAlert(AlertType type, String contentText, Image icon)
        {
            show(type, type.name(), "", contentText, icon, true);
        }
    
        public static void showAlert(AlertType type, String title, String headerText, String contentText, Image icon, boolean centerOnScreen)
        {
            show(type, title, headerText, contentText, icon, centerOnScreen);
        }
    
        private static void show(AlertType type, String title, String headerText, String contentText, Image icon, boolean centerOnScreen)
        {
            Alert alert = new Alert(type);
            alert.setTitle(title);
            alert.setHeaderText(headerText);
            alert.setContentText(contentText);
            Stage dialogStage = (Stage) alert.getDialogPane().getScene().getWindow();
            if(icon != null)
            {
                dialogStage.getIcons().add(icon);
            }
            if (centerOnScreen)
            {
                dialogStage.centerOnScreen();
            }
            alert.showAndWait();
        }
    }