title: How to change the image of a JButton?
body: <p>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.</p>
  
  <p>How can I do this?  </p>
  
  <p>I was doing this: </p>
  
  <pre><code>cards[i].setIcon(cardBack);
  </code></pre>
  
  <p>where cardBack is an ImageIcon that I already have.    </p>