3

CREATING A GUI FOR OUR GUESSING GAME

Image

In this chapter, we’ll create a GUI version of the Hi-Lo guessing game from Chapter 2, as shown in Figure 3-1. When this version of the program runs, it presents a graphical, or visual, interface that users will interact with. The GUI version allows the user to play the game in a desktop window like the applications you use every day. It’s a professional, windowed app complete with a text field for the user’s guess, a button to submit the guess, and a label that tells the user if they’ve guessed too high, too low, or correctly.

Figure 3-1: A GUI version of the Hi-Lo guessing game running on Windows (left) ...

Get Learn Java the Easy Way now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.