No events when drag target is removed from the scenegraph while dragging

Richard Bair richard.bair at
Fri Aug 16 08:38:25 PDT 2013

The existing behavior does sound consistent at least. When a drag starts, the node "captures" the mouse and doesn't let go until the event concludes. This is the same as if the node had remained in the scene graph. Since the node is no longer in the scene graph, there is no hierarchy to bubble / filter / capture events in.

What other options are there which would also work? We could send a mouse drag ended, mouse release, etc to the node which has been removed from the scene graph and then start a new drag event at the current location. I'm guessing this is the behavior you were looking for?


On Aug 16, 2013, at 7:53 AM, Sebastian Rheinnecker <sebastian.rheinnecker at> wrote:

> Hello,
> we're not sure if we are doing something wrong but in our testing we noticed a behavior of javafx event processing that is unfortunate.
> I attached a SSCCE that shows the issue. In the application, an ellipse shape is following the mouse, and when you click and drag, a listener that is called upon MouseEvent.DRAG_DETECTED removes the drag target from the scene graph (in this case, the ellipse) and immediately places a newly created ellipse in the same place.
> The issue is: as soon as the ellipse (the drag target) is removed from the scene graph, no events are fired anymore for the entire drag operation *at all*. The sample application binds listeners to the scene, the stage and to the window but no mouse events are received until the user releases the mouse button. This happens in JavaFX 2.x as well as JavaFX 8.
> We'd like to know if this is the intented behavior or a bug and if there is a way to receive the missing mouse events somehow.
> Thanks in advance and kind regards,
> Sebastian Rheinnecker
> -- 
> Sebastian Rheinnecker
> phone: +49 7071 9709050
> fax: +49 7071 9709051
> yWorks GmbH
> Vor dem Kreuzberg 28
> 72070 Tuebingen
> Germany
> Managing Directors: Sebastian Müller, Michael Pfahler
> Commercial Registry: Stuttgart, Germany, HRB 382340
> <>

More information about the openjfx-dev mailing list