NEWT : Drag and Drop
Posted by jeremyl on Oct 05, 2016; 8:38am
URL: https://forum.jogamp.org/NEWT-Drag-and-Drop-tp4037287.html
Hi All,
We recently choose to use Newt (instead of GLCanvas). And we want to have same fonctionnality and API (especially mouseEvent).
In order to do that, we get mouseEvent from GLWindow, create Awt event from them, and after we dispatch these Awt events to the component that we want.
It's working except the drag and drop : I want to drag and drop a shape from a GLWindow into this GLWindow (so I only want to move this shape into the GLWindow using drag and drop), and I can't because at the beginning of drag and drop, I have :
java.awt.dnd.InvalidDnDOperationException: Cannot grab pointer: already grabbed
at sun.awt.X11.XDragSourceContextPeer.throwGrabFailureException(XDragSourceContextPeer.java:297)
at sun.awt.X11.XDragSourceContextPeer.startDrag(XDragSourceContextPeer.java:206)
at sun.awt.dnd.SunDragSourceContextPeer.startDrag(SunDragSourceContextPeer.java:135)
at java.awt.dnd.DragSource.startDrag(DragSource.java:321)
at java.awt.dnd.DragSource.startDrag(DragSource.java:426)
at java.awt.dnd.DragGestureEvent.startDrag(DragGestureEvent.java:263)
I think it because the drag and drop system want to change the cursor. But I don't understand why I have these error : I don't grab the pointer before the drag.
Do you have an idea? Maybe Newt/GLWindow grab the pointer ? Maybe DnD is not compatible with Newt ?
I hope you can help me.
Regards.