Drag Done Screen Coordinates

Andy Goryachev andy.goryachev at oracle.com
Fri Sep 29 16:16:29 UTC 2023


I had the same problem with my docking framework [0], which was initially implemented using DnD.  There were other problems which could not be solved at the time, so I had to switch to a more low-level implementation using floating stages and event handlers.

-andy

[0] https://github.com/andy-goryachev/FxDock



From: openjfx-dev <openjfx-dev-retn at openjdk.org> on behalf of Dirk Lemmermann <dlemmermann at gmail.com>
Date: Friday, September 29, 2023 at 08:47
To: openjfx-dev <openjfx-dev at openjdk.org>
Subject: Drag Done Screen Coordinates
Hi there,

our application uses drag and drop to move an item out of a stage and onto the desktop. We then want to show a new stage showing the item. For this we need the screen coordinates when the drag and drop is „done“. However, those coordinates are always 0 / 0. I found this bug report [0] mentioning it and the conclusion / the analysis was, that it was sufficient that the „dragDropped“ event already contains the coordinates. I think this is wrong. The problem is that the „dropped“ event gets called on the node where the drop happens, and not on the node where the drag operation started. However, when dropping on the desktop there is no JavaFX node that could possibly receive the „dragDropped“ event. Correct me if I am wrong.

Our application is using a docking framework and it is really pushing the DnD support. Docking elements can be dragged and dropped within the docking pane, from one docking pane to another, from one stage to another stage, and finally from one stage to the desktop. Everything is working except for the drag to the desktop.

Dirk

[0] https://bugs.openjdk.org/browse/JDK-8094700
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20230929/613cc90c/attachment.htm>


More information about the openjfx-dev mailing list