Question: In jGrasp My Matching Gamejava Driver Write a Driver similar to the ones you wrote in the other GUI labs Panel Write a matching game
My Matching Gamejava Driver Write a Driver similar to the ones you wrote in the other GUI labs Panel Write a matching game program. Use BorderLayout with 3 panels. The north panel will have 5-6 buttons with an icon or words on each. Use Paint to resize all the pictures to the same dimensions. The center panel will have a title and/or directions. The south panel will have 5-6 buttons that can be "matched" to the north buttons. The order in the south will be different than the north. Output a statement or sound when the match is correct or not. Match the ACC school with it's mascot The Logic In the panel you will need to keep track of the first button pressed, so when the second button is pressed, you'll know if you have a match. Below is the easiest way to do it. Create a private int, called choice, above the constructor (with the components) Attach each button to its own Listener. When a top row button is selected, set choice to a number representing that button. In the matching bottom row button's Listener, check choice and determine if the match was correct or not. Play your correct sound or incorrect sound Then reset choice to 0. You must select a top row button first, and then a bottom row button. See below
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
