I am developing a JavaFX application, used jfxtrans.mouseutil
to make an anchor pane draggable, I want to bound or limit the draggable area to its parent, parent is also anchor pane.
I have tried to bound draggable area with checking the layoutx and layouty of the draggable pane but not working any solution?
My code:
MouseControlUtil.makeDraggable (testpane, new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
testpane.setLayoutX(1);
}
}, new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
}
});