title: Event Handling in JavaFX
body: <p>I am confused all about the subject of event handling. </p>
  
  <p>I am trying to implement a game. I already wrote the game logic separately, and the GUI (on JavaFX).</p>
  
  <p>Below is some sample code; What can I do so that the <code>updateScoresLabel()</code> method will run whenever the <code>setScore(...)</code> method is executed?</p>
  
  <pre><code>public class MyGameLogic
  {
      private int scores=0;
  
      public void setScore(int scores)
      {
          this.scores=scores;
      }
  
      public int getScore()
      {
          return scores;
      }
  
  }
  
  
  
  public class JustAGUIExample
  {
      Label scoresLabel;
      MyGameLogic gameLogic;
  
      public void updateScoresLabel()
      {
          this.scoresLabel=gameLogic.getScore();
      }
  }
  </code></pre>