So I'm trying to get the user to enter text into a text box and my program will tell the user how many letters the word contains. I initialized the variable String1 (String String1;
) to be the word the user entered. Now the part I'm confused about is that when I try to set the label for the answer to display the answer I get the error
int cannot be converted to string.
Here's the part of the code I'm stuck on:
String String1;
String1 = txtlength.getText();
lblLengthAnswer.setText (String1.length());