Javafx adding ActionListener to button
<pre><code>button.setOnAction(new EventHandler&lt;ActionEvent&gt;() {
    @Override public void handle(ActionEvent e) {
        label.setText("Accepted");
    }
});
</code></pre>

<p>In the code above we are defining what will happen when we press the button. This is all good but I wanna create new ActionListener and then add it to my button.
Normally in JButton I can just add ActionListener like this:</p>

<pre><code>button.addActionListener(someControllerClass.createButtonListener());
</code></pre>

<p>In code above createButtonListener() returns ActionListener.</p>

<p>My question is: What is the equivalent of JButton addActionListener ?</p>