0
I made a ChoiceBox
, but a problem occurs; when I leave the stage and then return, the ChoiceBox
continues with the previously chosen item. I want that when leaving and then returning, it returns to the initial state, that is, without chosen item.
How to do that? Look at a part of the code:
cb.getSelectionModel().selectedIndexProperty().addListener((ObservableValue<? extends Number> obs, Number old , Number newValue)->{
switch(newValue.intValue()){
case 0:
validarSemChoiceBox = true;
nivelDaTarefa = fonemas;
new TictactoeViewController().limparJogo();
break;
case 1:
validarSemChoiceBox = true;
nivelDaTarefa = silabas;
new TictactoeViewController().limparJogo();
break;
case 2:
validarSemChoiceBox = true;
nivelDaTarefa = palavras;
new TictactoeViewController().limparJogo();
break;
}
});