I have a grid layout with image nodes, and I want to add dnd functionality to my application, for example, when I drag the node image into the target JPanel, some actions, for example, show in the original size, delete, etc. I achieve this with the transfer methods with one and with DropTargets, DragSource, etc. But I have two questions, and I want to discuss them with you.
a) Which of the two methods is better to use? I understand that the second method gives me more options than TransferHandler, and the first is the easiest to use. But I can do my job in both ways, is there a more efficient of the two, or all that I prefer to code.
b) While dragging, I want to display the image next to the cursor. The first thing I do is use the JFrame glass panel and create a JCompoment that draws the correct image and follows the cursor. Can I do it this way? After that, I see in the documentation that the startDrag method for the DragSource receives the dragImage argument, for this reason I want, I try to transfer the image, but I do not see any results.
-------------- UPDATE ---------------------
In the second question (b), I tried with glass glass, but I had a problem in the interaction between DNN and my listeners to display the thumb of the image in glass glass. each time only one of them works correctly.
!!! More specifically, the mouseDragged event does not fire when I already called the startDrag () method
Thank you for your time.