Question: Create a target practice game that allows the user to click moving targets and displays the number of hits in a 10-second period. (In Chapter
Create a target practice game that allows the user to click moving targets and displays the number of hits in a 10-second period. (In Chapter 4, you learned how to use the LocalDateTime class to measure elapsed time.) Create a grid of at least 100 JPanels. Randomly display an X on five panels to indicate targets. As the user clicks each X, change the label to indicate a hit. When all five Xs have been hit, randomly display a new set of five targets. Continue with as many sets as the user can hit in 10 seconds. When the time is up, display a count of the number of targets hit. Save the file as JTargetPractice.java.
Step by Step Solution
3.43 Rating (162 Votes )
There are 3 Steps involved in it
import javaawt import javaxswing import javaawtevent import javautil import javatime public class JTargetPractice extends JFrame implements MouseListe... View full answer
Get step-by-step solutions from verified subject matter experts
