Reputation: 45
Im an intermediate programmer making my own little image viewer. Currently I'm looking into implementing a Drag-and-Drop feature. Ive done some research and have seen that you need to use image icon b/c it is serializable, the code seems pretty complicated. The DnD would be on images dragged to the panel. I have a few questions.
Upvotes: 1
Views: 471
Reputation: 36611
Implementing drag-and-drop functionality is not that hard
TransferHandler
as explained hereTransferHandler
on your Swing componentDataFlavor
is used when dragging your image data (see also the tutorial) and make sure your handler accepts itUpvotes: 2