The Java EE 6 Tutorial

ProcedureTo Run the guessnumber Example

  1. In a web browser, type the following URL:


    http://localhost:8080/guessnumber
    

    The Guess My Number page opens, as shown in Figure 19–2.

    Figure 19–2 Guess My Number Example

    Guess Number example at beginning of game

  2. Type a number in the Number text field and click Guess.

    The minimum and maximum values are modified, along with the remaining number of guesses.

  3. Keep guessing numbers until you get the right answer or run out of guesses.

    If you get the right answer, the input field and Guess button are grayed out, as shown in Figure 19–3.

    Figure 19–3 Guess My Number at End of Game

    Guess Number example at end of game

  4. Click the Reset button to play the game again with a new random number.