Friday, 11 April 2014

Go Fish

I'm finished with most of the JComboBox. Now the card number will be compared with computerHand and if the computer has the card the card will be removed from the computer's hand and a JOptionPane will pop up to tell you that you've found the ____ card.

There's a boolean to control whether found is true or not and this is so when the for loop (to find the matching value) runs, it won't tell you that the card isn't found after it has only gone through the loop once. Because the card you want to find might just not be the first one on the list. All this happens in a method called matchCards and then matchCards is put into the mouseClicked method.

The line of code that selectedNumber is declared is put into the mouseClicked method rather than the matchCards();

No comments:

Post a Comment