I'm having some issues with a switch, or at least I think it's the switch...
Theoretically, after the switch receives a "YES", it should change the state String to "EXPLORE", thus ending the whole chain. But that's not what's happening.Code:
// STATE is a String, command is a JTextField
// This is all inside of an ActionListener, so nothing happens until it gets input.
String name = command.getText();
display.append("\nAre you sure you want your name to be " + command.getText() + "?");
case "YES": case "Y":
display.append("\nWelcome to Generica, " + player.getName() + "!");
STATE = "EXPLORE";
case "NO": case "N":
display.append("Well what is your name, then?");
What is your name, Adventurer?
Are you sure you want your name to be John?
Are you sure you want your name to be Yes?
Welcome to Generica, Yes!
Any idea why I'm getting the odd looping?
Thanks in advance!