circle.setOnMousePressed(e->{ if (animation.getStatus().equals(animation.getStatus().RUNNING)) animation.pause(); else animation.play(); });