Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hello I have encountered an issue where everything works fine until the if ( result . equals ( Hello , + name
Hello I have encountered an issue where everything works fine until the
if resultequalsHello name "ready to start to the game?"
nameField.setEnabledfalse;
oneButton.setEnabledtrue;
twoButton.setEnabledtrue;
threeButton.setEnabledtrue;
fourButton.setEnabledtrue;
this is the entire code:
private void nameButtonActionPerformedjavaawt.event.ActionEvent evt
String name nameField.getText;
String result processUsername;
storyArea.setTextresult;
if resultequalsHello name "ready to start to the game?"
nameField.setEnabledfalse;
oneButton.setEnabledtrue;
twoButton.setEnabledtrue;
threeButton.setEnabledtrue;
fourButton.setEnabledtrue;
public String processUserString name
if namelength
returnThere are too many characters";
else if nameisEmpty
returnTo begin the story, enter your name";
else if namematches@#$&;:
returnNo numbers or symbols allowed in the name";
return Hello name ready to start to the game?";
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started