Question

Create a Mine Field game in which the user attempts to click 10 panels of a grid before hitting the “bomb.”
a. Set up a four- by- five grid using GridLayout and populate the grid with JPanels.
b. Set the background color for all the JPanels to Color. BLUE.
c. Randomly choose one of the panels to be the bomb; the other 19 panels are “safe.”
d. Allow the player to click on grids.
e. If the player chooses a safe panel, turn the panel to Color. WHITE.
f. If the player chooses the bomb panel, turn the panel to Color. RED and turn all the remaining panels white.
g. If the user successfully chooses 10 safe panels before choosing the bomb, display a congratulatory message.