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
2021-12-08 09:40:50 +01:00

24 lines
759 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) {
@NotNull
final Alert alert = new Alert(Alert.AlertType.INFORMATION);
extracted(title, description, alert);
}
private static void extracted(String title, String description, @NotNull Alert alert) {
alert.setTitle(title);
alert.setContentText(description);
alert.show();
}
}