Graphical user interface and arrays, Basic Computer Science

In this program, you are going to write a program for playing the game of Hangman. In this game, the computer will pick a word and display a sequence of blanks to be filled in; one for each letter. The player will make guesses about what letters are in the word. If he/she guesses a letter that appears in the word, the appropriate blanks will be filled in. If the guess is a letter that doesn''t appear in the word, one part will be added to a figure hanging from a scaffold. When the hanging figure is complete (seven bad guesses), the game is lost.
Objectives:

* Write a GUI program
* Implement the ActionListener interface to handle Events
* Use arrays
You are to write the Hangman class (a driver class that creates the main window for this GUI program), HangmanPanel (a JPanel which contains all the components needed to run the program) and any other classes that you need to make this game work.

Specification:
* Hangman
o Your main class should create a JFrame and put a HangmanPanel in its content pane.
* HangmanPanel
o This class should extend JPanel and contain all the components needed for the user to play the game
+ The user should be able to start a new game and quit the program.
+ You need to provide components to display the letters that are are currently known as well as to allow the user to select a letter from the ones which have not yet been guessed.
+ You need a way to display the current state of the hanged man.
+ You will need at least one Listener class.
o When the game starts, the program should get a word from the WordList class (see below) and initialize the available letters and the blanks to be filled in. The words in this version of the game will all have eight letters in them.
* There should be no console output in this program
* All input to the program should be handled with components. JOptionPane dialogs should not be used for input.
* Handle all appropriate exceptions.
Posted Date: 4/6/2012 8:24:24 PM | Location : United States







Related Discussions:- Graphical user interface and arrays, Assignment Help, Ask Question on Graphical user interface and arrays, Get Answer, Expert's Help, Graphical user interface and arrays Discussions

Write discussion on Graphical user interface and arrays
Your posts are moderated
Related Questions
Question 1 Explain the importance of graphics in multimedia. What are few of the tips to keep in mind while using graphics for the web? Question 2 Write a long note on co

1. Suppose that the meaning of the BUN instruction of the Basic Computer is changed to implement the relative addressing mode, i.e PC a) Write an optimal operation sequence to im


Breadth First Search - artificial intelligence: Given a set of operators o1, ..., on in a breadth primary search, every time a new state s is reached, an action for every  oper

Selects among the processes in memory which are ready to execute & allocates the CPU to one of them CPU scheduling decisions can be taken place when a process: A. Terminates B. Swi

Configuration of a PC: Generally, when you think of purchasing a Computer, you first try to exactly know what will be the hardware components such as processor, memory etc. of

Importance of Good Database Design Poor database design may have results in unwanted data redundancy Poor database design keeps errors leading to bad decisions and results Practica

Question 1 List and explain the ways used to close an MS Word document Question 2 What is MS-Excel? List the steps involved in starting Microsoft Excel Question 3 What i

Ask question #MiniA string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''''a''