Archived
1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
Java_TP/src/fr/univ/lyon1/gui/controller/Dialog.java
2022-01-07 11:38:15 +01:00

29 lines
984 B
Java

package fr.univ.lyon1.gui.controller;
import javafx.scene.control.Alert;
import org.jetbrains.annotations.NotNull;
public class Dialog {
public static void showErrorDialog(String title, String description) {
@NotNull
final Alert alert = new Alert(Alert.AlertType.WARNING);
extracted(title, description, alert);
}
public static void showSuccessDialog(String title, String description) {
System.out.println("Create success dialog...");
@NotNull
final Alert alert = new Alert(Alert.AlertType.INFORMATION);
System.out.println("Extracting...");
extracted(title, description, alert);
}
private static void extracted(String title, String description, @NotNull Alert alert) {
System.out.println("Set title");
alert.setTitle(title);
System.out.println("Set description");
alert.setContentText(description);
System.out.println("Show");
alert.show();
}
}