DND - Custom drag gesture recognizer
I have a JButton as a drag source and would like to invoke a custom drag gesture
recognizer to initiate the drag gesture when the user clicks the JButton.
However, when I try to create an instance of the drag gesture recognizer
from either method below I get returned a null instead of an instantiated
class!?
(1)
myDragGestureRecognizer = (MyDragGestureRecognizer)dragSource.createDragGestureRecognizer(
MyDragGestureRecognizer.class, button, DnDConstants.ACTION_COPY_OR_MOVE,
this );
or (2)
myDragGestureRecognizer =
Toolkit.getDefaultToolkit().createDragGestureRecognizer(MyDragGestureRecognizer.class,
dragSource, button, DnDConstants.ACTION_COPY_OR_MOVE, this);
Can anyone tell me how to create the custom drag gesture recognizer? Thanks.