24 lines
759 B
Java
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();
|
|
}
|
|
}
|