Hi,
I am new to Java applets. I am trying to create a Hangman program. For this, I need textfields for the number of letters the word has. I wrote the following code, but it did not create any textfields. Could you kindly tell me where I am going wrong ?
TextField letter;
for (int i = 0; i < 5; i++){ //suppose the word is 5 letters long
letter = new TextField(" ",1);
add(letter);
}
I have written this code in the init() method.
Thank you for your help,
priyanka
I am new to Java applets. I am trying to create a Hangman program. For this, I need textfields for the number of letters the word has. I wrote the following code, but it did not create any textfields. Could you kindly tell me where I am going wrong ?
TextField letter;
for (int i = 0; i < 5; i++){ //suppose the word is 5 letters long
letter = new TextField(" ",1);
add(letter);
}
I have written this code in the init() method.
Thank you for your help,
priyanka
Comment