title: Why can't I call method from event listener but can elsewhere in class?
body: <p>I have the following code in a controller class in for a JavaFX GUI that provides an event listener for a combo box:</p>
  
  <pre><code>courseComboBox.getSelectionModel().selectedItemProperty()
                  .addListener(new ChangeListener&lt;String&gt;() {
                      @Override
                      public void changed(
                              ObservableValue&lt;? extends String&gt; selected,
                              String oldValue, String newValue) {
  
                             // Do stuff
  
      }
  });
  </code></pre>
  
  <p>However, when I try to call another method from within it I am unable to:</p>
  
  <pre><code>courseComboBox.getSelectionModel().selectedItemProperty()
                      .addListener(new ChangeListener&lt;String&gt;() {
                          @Override
                          public void changed(
                                  ObservableValue&lt;? extends String&gt; selected,
                                  String oldValue, String newValue) {
  
                                  this.setClassList(courseProcessed);
  
                                 // Do Stuff
  
     }
  });
  </code></pre>
  
  <p>I can call the method elsewhere in the class, though. More specifically, I can call it inside the <code>initialize()</code> function in my controller that this listener also resides in. Why am I having this problem?  </p>