-
Notifications
You must be signed in to change notification settings - Fork 0
/
DialogBoxes.java
35 lines (28 loc) · 1.03 KB
/
DialogBoxes.java
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
import javax.swing.JOptionPane;
/**
* Write a description of class DialogBoxes here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class DialogBoxes {
static String userInput;
// have no use for this method in this project but I will implement it in the future
public static String confirmDialog(String msg) {
return null;
}
public static boolean yesNoOption(String msg, String boxTitle) {
int n = JOptionPane.showConfirmDialog(null, msg, boxTitle,
JOptionPane.YES_NO_OPTION);
return n == JOptionPane.YES_OPTION;
}
public static String InputDialog(String msg) {
return JOptionPane.showInputDialog(msg);
}
public static void messageDialog(String msg) {
JOptionPane.showMessageDialog(null, msg);
}
public static void errorMessage(String msg) {
JOptionPane.showMessageDialog(null, msg, "Error", JOptionPane.ERROR_MESSAGE);
}
}