I'm working on a memory game program. I have 30 JButtons on a JPanel. When the user is clicking and finds a match (meaning two buttons with the same image) I want to change the image on the JButton to a different image. However this does not happen while the program is running.
How can I do this?
I was doing this:
cards[i].setIcon(cardBack);
where cardBack is an ImageIcon that I already have.