The
dragMouseMoved
event handler is a special user-defined
Function
that can be added to a component when it is created
and that will be called automatically with a single
DragSourceEvent
argument as the cursor moves during a drag operation
started by the component's
dragGestureRecognized
event handler.
A
dragMouseMoved
event handler can only be added via
addEventHandler
after a component is created,
but an existing
dragMouseMoved
event handler can always be changed or temporarily disabled,
which is what happens when
NULL,
is assigned to
dragMouseMoved.
Drag and drop operations that are interested in cursor movement favor
dragOver
because they normally restrict their attention to a few components.
However, if an application wants to track the cursor over the entire
screen during a drag and drop operation then
dragMouseMoved
is the only choice.
In those cases
dragMouseMoved
will usually only be interested in the
cursor
and
screenlocation
fields in its
event
argument.
Java's drag and drop support was has been around for quite a while, but
dragMouseMoved
is relatively new and not available if you are using a version of Java
that is older than 1.4.0.
Some Swing components provide automatic drag and drop handling that
currently must be disabled by storing
NULL
in their
transferhandler
field before your drag and drop event handlers will start working.
In other words, you probably should include a declaration that looks
something like,
Object transferhandler = NULL;
whenever you build a Swing component provides its own drag and drop
event handlers.
| |
| Return: |
none
| | |
| See Also: |
actionPerformed,
addEventHandler,
adjustmentValueChanged,
caretUpdate,
componentHidden,
componentMoved,
componentResized,
componentShown,
dragDropEnd,
dragEnter,
dragExit,
DragGestureEvent,
dragGestureRecognized,
dragOver,
DragSourceEvent,
drop,
dropActionChanged,
DropTargetEvent,
focusGained,
focusLost,
hyperlinkActivated,
hyperlinkEntered,
hyperlinkExited,
invocationAction,
invocationBrowse,
invocationChange,
invocationEdit,
invocationEditImport,
invocationEditKey,
invocationRun,
invocationSelection,
itemStateChanged,
keyPressed,
keyReleased,
keyTyped,
mouseClicked,
mouseDragged,
mouseEntered,
mouseExited,
mouseMoved,
mousePressed,
mouseReleased,
mouseWheelMoved,
removeEventHandler,
stateChanged,
textValueChanged,
valueChanged,
windowActivated,
windowClosed,
windowClosing,
windowDeactivated,
windowDeiconified,
windowIconified,
windowOpened
|
|