Avoid the java error
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Debucquoy Anthony 2023-05-18 00:11:51 +02:00
parent f625ec36a4
commit fbaa79d35e
Signed by: tonitch
GPG Key ID: A78D6421F083D42E

View File

@ -15,14 +15,15 @@ public class MenuAccueil extends StackPane {
public MenuAccueil(){ public MenuAccueil(){
super(); super();
//create all the objet that I need //create all the objet that I need
ChoiceBox SlctDifficulty = new ChoiceBox(); ChoiceBox<String> SlctDifficulty = new ChoiceBox<>();
SlctDifficulty.getItems().addAll("Easy", "Medium", "Difficult"); SlctDifficulty.getItems().addAll("Easy", "Medium", "Difficult");
Label RdmLvl = new Label("Random Level : "); Label RdmLvl = new Label("Random Level : ");
Button SelectLevel= new Button("Select Level"); Button SelectLevel= new Button("Select Level");
Label Title = new Label("Welcome to Road to Master"); Label Title = new Label("Welcome to Road to Master");
SlctDifficulty.setOnAction(event -> { SlctDifficulty.setOnAction(event -> {
String choosediff = SlctDifficulty.getSelectionModel().getSelectedItem().toString(); String choosediff = SlctDifficulty.getSelectionModel().getSelectedItem();
System.out.println(choosediff);
switch(choosediff){ switch(choosediff){
case "Easy": case "Easy":
SlctDifficulty.setOnAction(event1 -> MapGenerator.generate(MapGenerator.Difficulty.Easy)); SlctDifficulty.setOnAction(event1 -> MapGenerator.generate(MapGenerator.Difficulty.Easy));