final Duration duration = Duration.millis(1200);
BindableTransition transition = new BindableTransition(duration);
transition.setCycleCount(1000);
transition.setAutoReverse(true);
shadow.offsetXProperty().bind(transition.fractionProperty().multiply(32));
shadow.offsetYProperty().bind(transition.fractionProperty().multiply(32));
button.translateXProperty().bind(transition.fractionProperty().multiply(-32));
transition.play();
StackPane pane = new StackPane();
pane.getChildren().add(button);