title: Comparing JTextField to a string
body: <p>I'm working on a program that uses GUIs, and I'm pretty new to it. I am not sure why it is not letting me into my if statement or how to fix it. </p>
  
  <pre><code>    private JTextField player1Name; //It is assigned in a different place
  
      public void buttonClick(int button, JTextField cP) {
      int checkerPlaceRow;
      curPlay = cP;
      if (curPlay.getText().equals(player1Name)) {
          checkerPlaceRow = dropCheckerOne(button);
      }
  </code></pre>
  
  <p>There is some other stuff in this method, but this specific if statement is what I am having trouble with.</p>