-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLevel.java
37 lines (32 loc) · 805 Bytes
/
Level.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
36
37
import javax.swing.JOptionPane;
/**
* Creates a custom dialog to change level.
*
* @author Turgut Guvercin
* @version January 2022
*/
public class Level
{
private String[] choices;
private String input = null;
/**
* Constructor for objects of class Level
*/
public Level()
{
}
/*
* Method to send the user's choice
*/
public String getLevel(){
String l = "screens/screen.";
String[] choices = { "1", "2", "3", "4", "5", "6" };
String input = (String) JOptionPane.showInputDialog(null, "Choose a Level",
"Level", JOptionPane.QUESTION_MESSAGE, null, choices, choices[0]);
//System.out.println(input);
if(input == null){
return input;
}
return l+input;
}
}