
Create a web application that will allow a user to play the popular Hangman computer game using Java application program.
How to play Hangman: The computer will randomly choose a word from an array. This array must have a minimum of 10 words and must be loaded from a text file of words. A sample text file named Words.txt is created. The same number of labels, as there is letters in the chosen word must be displayed on the game frame screen so that the user knows how many letters are in the word. The user will try to guess the word by clicking a letter from a display of all letters of the alphabet (or by typing in the letters in the labels). Each letter is a separate button that can be clicked.
Each time the user chooses a letter, the computer checks to see if that letter is in the chosen word in the right position. If the letter is in the word, it will be displayed in the correct position and a message of correct will be displayed. If it is not in the word, a part of the man will be drawn on the game screen. The object of the game is to try and guess the word before the man is hanged. If the man is hanged, i.e. after 6 loses, the user loses and the correct word is displayed.
The program must also ask the user whether they wish to play again and keep scores for the user for a playing session. The following statics must be displayed per playing session on the web form: number of games played, number correct and number lost. Also have an option to allow the user to add new words to the file. Instructions: 1. Display however many labels as needed by the number of characters of the chosen word. 2. Add 4 buttons or menu options: One for accessing help using the program, one for adding new words, one for clearing the screen/ restart/ Start a new game and one for exiting the program. 3. In the correct event handler, write program code to check if the entered letter is the correct letter. 4. If the letter is incorrect display or draw one part of the man(One of the body part images) 5. If 6 parts of the man�s body is displayed, the user loses. Report that the game is over. 6. If the clear game/restart/new game button is pressed reset all labels to empty and choose another word. 7. If the help button is pressed, show a help screen that gives instructions on how to use the game.

Here is a simple program of Hangman game.
import java.util.*;
public class Hangman{
public static void main( String[] args){
Scanner scan = new Scanner( System.in);
int totalMistake = 0;
boolean b = false;
System.out.println("Welcome to Hangman Game:)!!" );
SecretWord word = new SecretWord();
Input input = new Input();
while(totalMistake < 4 && !word.isSolved()){
System.out.println(word);
char c = input.getNewLetter();
if (!word.update(c))
totalMistake = totalMistake + 1 ;
}
if (word.isSolved())
System.out.println("Great, you done it.");
else
System.out.println("Sorry, too many errors.");
}
}
class SecretWord{
String visible, secret;
public SecretWord(){
String [] wordList = { "Giraffe", "Camel", "Lion", "Bear","Zebra","Monkey","Leopard","Rhinoceros","Elephant","Dear" };
int rand;
rand = (int) (Math.random()*4);
secret = wordList[rand];
int wordLength = secret.length();
visible = "";
for( int i = 0; i < secret.length(); i++){
char c = secret.charAt(i);
if( c == ' ' )
visible += c;
else
visible += '_';
}
}
public String toString(){
return visible;
}
public boolean update(char c){
char[] secretArray = new char[secret.length()];
char[] visibleArray = new char[secret.length()];
String s = "";
boolean contains = false ;
for(int i = 0; i < secret.length(); i++){
secretArray[i] = secret.charAt(i);
visibleArray[i] = visible.charAt(i);
}
for(int k = 0; k < secret.length();k++){
if(secretArray[k] == c){
visibleArray[k] = c;
contains = true;
}
}
for(int m=0; m < secret.length(); m++ )
{
s = s + visibleArray[m];
}
visible = s;
return contains;
}
public boolean isSolved()
{
return secret.equalsIgnoreCase(visible);
}
}
class Input
{
ArrayList<String> keyList ;
boolean chosen;
public Input()
{
keyList = new ArrayList<String>();
}
public void keyChosen( String key )
{
keyList.add( key );
}
public boolean hasBeenChosen( String key)
{
chosen = keyList.contains( key );
return chosen;
}
public char getNewLetter()
{
Scanner scan=new Scanner( System.in);
char a;
boolean chosen;
String aTmp;
do
{
System.out.println("Enter a Letter");
a = scan.next().charAt( 0);
aTmp = "" + a;
chosen = hasBeenChosen( aTmp);
if(!chosen)
keyChosen( aTmp);
else
{
System.out.println("You've already used that one. Please enter a new Letter");
}
}
while(chosen);
return a;
}
}

Can you please show me how to do the following using Jframe form?
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.