The goal of this project is to become more familiar with creating and using classes and objects in Java, to further introduce you to the concepts of abstraction and modularization, and to introduce you to collections of items. In this project you will build on your Project 5. You will complete your Hangman so it contains everything we need to display and control our game.


Create a new Java project named “Project6_netid” (where you replace netid with your NetID), copy files from Projects 3, 4, and 5 to this new project

You now have all of the pieces needed to complete the game, so make it work

  • Coordinate the user input to appropriately change the alphabet panel, the person, and the guess phrase based on each letter pressed. Hint: you may need to make your HangmanGame a JFrame as well.
  • Modify AlphabetPanel to turn incorrect letters a different color (like red) after they have been guessed. Similarly, correct letter guesses should also be turned a different color (like green) after being entered by the user. Hint: you may need to move the AlphabetPanel’s key listener into your HangmanGame class.
  • Clicking in the window should not advance the person – only incorrect letters should do that and ONLY the first time the incorrect letter is pressed (pressing the same incorrect letter over and over should not cause any more body parts to show).
  • Ask the user if they want to play again. If they do, reset the guess phrase to a new phrase and reset the rest of the game.

EXTRA CREDIT: Add comments for correct/incorrect answers. NOTE: You can use two files for this and reuse your RandomString class from Project 5. Display a corresponding comment from the person being hung, negative if the user/player guessed wrong, positive or encouraging if the user/player got it right.

Be sure to comment everything

  • Each of your methods (including their parameters).
  • Anything else that needs explanation.

You MUST do the following also:

  • You must name the file with your guess phrases: “guess_phrases.txt”
  • Submit a runnable JAR file. See the hints below that tell you how to do this. This JAR file is basically an executable that you will be able to double click to launch your program. Note: you will still need to have your "guess_phrases.txt" file in the same directory as your JAR file

Be sure to:

  • Use proper indentation
  • Use appropriate variable/field names
  • Group like things together (items that are part of the same objects)
  • Use appropriate comments – including comments for each method
  • Check your curly braces

Hints / tips

As part of project 6 you need to make the logic of the game work properly as well as ask the user if they would like to play again. You may find it useful to use the following logic:

if person or phrase is revealed process the user's Y/N answer else process the input as usual for the game, updating the person, guess phrase panel, & alphabet panel as appropriate if person or phrase is revealed ask the user if they would like to play again

Academic Honesty!
It is not our intention to break the school's academic policy. Projects posted are only used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly fill out the form. Please provide a valid email address and we'll get back to you in less than 24 hours. We will be sending an invoice through PayPal upon confirmation. We are a non profit organization however we need an amount to keep this organization running, and to be able to complete our research and development.