-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlertHandler.java
More file actions
35 lines (27 loc) · 897 Bytes
/
Copy pathAlertHandler.java
File metadata and controls
35 lines (27 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* File: proj6BayyurtWenZhang.AlertHandler.java
* Names: Izge Bayyurt, Muqing Wen, Chloe Zhang
* Class: CS361
* Project 6
* Date: 3/17/2022
*/
package proj6BayyurtWenZhang;
import javafx.scene.control.ButtonBar;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Dialog;
public class AlertHandler {
public AlertHandler(){}
/*
Creates a dialog box with custom message and title to display alerts
@param message: the alert text to show
@param title: the title of the alert box
*/
public void showAlert(String message, String title) {
Dialog<String> dialog = new Dialog<>();
dialog.setTitle(title);
dialog.setContentText(message);
ButtonType ok = new ButtonType("OK", ButtonBar.ButtonData.OK_DONE);
dialog.getDialogPane().getButtonTypes().add(ok);
dialog.showAndWait();
}
}