It is to support image dragging. How to find if an image is clicked in JApplet
?
I'm sure there is an easy way to do this, but I've looked everywhere and cannot seem to find it.
It is to support image dragging. How to find if an image is clicked in JApplet
?
I'm sure there is an easy way to do this, but I've looked everywhere and cannot seem to find it.
Options:
See the Drag and Drop and Data Transfer lesson of the tutorial.
If the purpose of the dragging is to change the order in a slideshow or similar, look to a JList
. See setDragEnabled(true)
& How to Use Lists for more details.
For the display component, I would recommend a JLabel
as suggested by @Hover. JList
uses a JLabel
as the rendering component by default.