title: How to remove or deactivate a listener
body: <p>So, the way I have things set up, is that at specific conditions, I want a listener to be active, and after it has fired, stop listening for changes. Maybe I'm missing something, but I can't seem to figure out how to use the <code>removeListener()</code> function, or if that's even the way to go about doing this.</p>
  
  <p>Some code:</p>
  
  <pre><code>        break1.setOnAction(e -&gt;{
          final String fieldValue = manage_money.getText();
          int pp = Integer.parseInt(platinum_num.getText());
          int gp = Integer.parseInt(gold_num.getText());
          int sp = Integer.parseInt(silver_num.getText());
          int cp = Integer.parseInt(copper_num.getText());
          if (fieldValue != null &amp;&amp; fieldValue.matches("\\d+")) {
              int value = Integer.parseInt(manage_money.getText());
              if (silver.isSelected()){
                  if (value &lt;= sp){
                      try {
                          tooltip_inv.getChildren().addAll(select);
                          radio_money2.selectedToggleProperty().addListener(((observable, oldValue, newValue) -&gt; {
                              if (newValue == copper){
                                  silver_num.setText(Integer.toString(sp - value));
                                  copper_num.setText(Integer.toString(cp + value * 10));
                                  manage_money.clear();
                                  tooltip_inv.getChildren().clear();
                              }
                          }));
                      } catch (IllegalArgumentException ex) {
                      }
                  }else{
                      manage_money.setText("ERR");
                  }
              }
          }else{
              manage_money.setText("NaN");
          }
      });
  </code></pre>