Look at this demo. The application produces draggable labels which can be moved all around the scene. To set the boundary limit the following technique is used: inside the onMouseDragged handler we compute the current position of the node and if it does not satisfy some condition we don't modify it. Particularly:
label.setOnMouseDragged(new EventHandler<MouseEvent>() {
@Override public void handle(MouseEvent mouseEvent) {
//Sets the drag boundaries limit
double newX = mouseEvent.getSceneX() + dragDelta.x;
if (newX > 200 || newX < 10) {
return;
}
label.setLayoutX(mouseEvent.getSceneX() + dragDelta.x);
label.setLayoutY(mouseEvent.getSceneY() + dragDelta.y);
}
});