code: public void hideWithAnimation() {
          if (transition == null || transition.getStatus().equals(Animation.Status.STOPPED)) {
              JFXAlertAnimation currentAnimation = getCurrentAnimation();
              Animation animation = currentAnimation.createHidingAnimation(getDialogPane().getContent(), getDialogPane());
              if (animation != null) {
                  transition = animation;
                  animation.setOnFinished(finish -> {
                      animateClosing = false;
                      hide();
                      transition = null;
                  });
                  animation.play();
              } else {
                  animateClosing = false;
                  transition = null;
                  Platform.runLater(this::hide);
              }
          }
      }
docs: play the hide animation for the dialog, as the java hide method is set to final
  so it can not be overridden