JavaFx handle dragging nodes from FXML controller of node or main?
<p>I am trying to drag some custom nodes. These nodes are added as children to an AnchorPane, as defined in the Controller of the root FXML:</p>

<pre><code>package sample;

import ...

public class Controller {
    @FXML
    AnchorPane anchorPane;

    public void add() {
        try {
            // Node.fxml is the custom node object
            Parent root = FXMLLoader.load(getClass().getResource("Node.fxml"));
            anchorPane.getChildren().add(root);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
</code></pre>

<p>Should I handle my node dragging within the root FXML controller or within the FXML controller of the draggable node itself?</p>

<p>If I should do it within the root FXML controller, how do I do this? Calling FXMLLoader.Load() just references an FXML file, and so I can't attach mouse events to it.</p>

<p>I'm pretty new to Java and JavaFx, so anything is helpful. (not a beginner to programming, however).</p>

<p>Thanks in advance.</p>