title: Changing text of JLabel where text is stats in another class
body: <p>I am making a game which has a store where in game coins can be spent. I want to display the amount of coins you have to spend. This value changes constantly as the game progresses. I have it capable of displaying the initial value and changing with purchases but it will not update from the other class.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>public StoreFrame(Run game,You y) {
      super("Store");
      theGame=game;
      setLayout(null);
      you=y;
      try {
          storeBack = ImageIO.read(new File("backgrounds/store.png"));
      } 
      catch (IOException e) {
      }
  
      //background
      setContentPane(new JLabel(new ImageIcon(storeBack)));
  
      coins = new JLabel("Coins: "+you.gettotCoins());//here is the problem
      coins.setFont(new Font("SanSerif", Font.BOLD, 18));
      coins.setForeground(Color.black);
      coins.setBounds(25, 25, 100, 100);
      add(coins);     
  
      setSize (800,600);  
      setResizable(false);    
      setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
  }
  </code></pre>
  
  <p>The class the text comes from:</p>
  
  <pre><code>public class You {
  
      private int totCoins;
  
      public You(int p) {
          totCoins=110;//starting money
      }
  
      public int gettotCoins() {
          return totCoins;
      }
  
      public void settotCoins(int subtract) {
          totCoins-=subtract;
      }
  }
  </code></pre>
  
  <p>Please help</p>