I am trying to catch events on the JavaFX Slider , especially one that indicates that the drag and drop has stopped and has been released. At first I used valueProperty with mock code like this
slider.valueProperty().addListener(new ChangeListener<Number>() { @Override public void changed(ObservableValue<? extends Number> ov, Number oldValue, Number newValue) { log.fine(newValue.toString()); } });
but with this it is updated too often. So I searched in SceneBuilder and the API and found some interesting options, like
slider.setOnMouseDragReleased(new EventHandler<MouseDragEvent>() { @Override public void handle(MouseDragEvent event) { System.out.println("setOnMouseDragReleased"); } });
but they never quit. There are only a few, such as setOnMouseReleased , I get some output, but this is, for example, counting for a whole Node, like labels, etc.
So my question is, is the right hook to know that the value does not change anymore (if possible after releasing the mouse, like a drag'n'drop gesture) and, perhaps with a small example, to see its interfaces work.
events javafx-2 slider drag-and-drop
thatsIch
source share