Check out example codes for "how to make stage dragable in javafx". It will help you in understanding the concepts better.

Code Example 1

private double x = 0;
    private double y = 0;

    private void makeCanDrag()	//make sure this method is called at the start.
    {

        parent.setOnMousePressed(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent event) {
                x = event.getSceneX();
                y = event.getSceneY();
            }
        });

        parent.setOnMouseDragged(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent event) {
                stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
                stage.setX(event.getSceneX() - x);
                stage.setY(event.getSceneY() - y);
                stage.setOpacity(.8f);
            }
        });
        parent.setOnDragDone(event -> {
            stage.setOpacity(1.0f);
        });
        parent.setOnMouseReleased(event -> {
            stage.setOpacity(1.0f);
        });
    }

Learn ReactJs, React Native from akashmittal.com