a. Create a game that helps new mouse users improve their hand-eye coordination. Within a JFrame, display

Question:

a. Create a game that helps new mouse users improve their hand-eye coordination. Within a JFrame, display an array of 48 JPanels in a GridLayout using eight rows and six columns. Randomly display an X on one of the panels. When the user clicks the correct panel (the one displaying the X), remove the X and display it on a different panel. After the user has successfully “hit” the correct panel 10 times, display a congratulatory message that includes the user’s percentage (hits divided by clicks). Save the file as JCatchTheMouse.java.

b. Review how to use the LocalDateTime class from Chapter 4, and then revise the JCatchTheMouse game to conclude by displaying the number of seconds it takes the user to click all 10 Xs. (For this program, assume that the user starts and stops the game during the same hour. That way, you only have to compare the minute and second values of the start and stop times.) Save the file as JCatchTheMouseTimed.java.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: