title: Updating one card's(JPanel) contents based on input from another card in CardLayout
body: <p>I have a set of JPanels arranged in CardLayout. The issue is that when I change things in one JPanel, I want the changes to be reflected in another JPanel that is a card in the same deck. I have a refresh() method defined on each of these JPanel objects but I cannot call them using the syntax that is used for shifting cards. (Here p is the container card for the deck of cards)</p>
  
  <pre><code>CardLayout cardLayout=(CardLayout)(p.getMenuCard().getLayout());
  cardLayout.show(p.getMenuCard(),"Card name");
  </code></pre>
  
  <p>I want to call the refresh() method but I don't know how to do that in CardLayout. Please help. </p>