-
Notifications
You must be signed in to change notification settings - Fork 0
/
New Message Template.txt
26 lines (24 loc) · 1.32 KB
/
New Message Template.txt
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
String[] messages = {
"",
};
String title = "Database";
int index = 0;
while (true) {
int option = JOptionPane.showOptionDialog(
null, messages[index], title, JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null,
new String[]{"🡠", "🡢"}, "Next"
);
if (option == JOptionPane.CLOSED_OPTION) {
// User closed the dialog
break;
} else if (option == 0 && index > 0) {
index--;
} else if (option == 1) {
if (index == messages.length - 1) {
// If the user pressed "🡢" at the last message, do not increment index
continue;
} else {
index++;
}
}
}