The
dragDropEnd
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 whenever a drag operation started by the component's
dragGestureRecognized
event handler ends.
A
dragDropEnd
event handler can only be added via
addEventHandler
after a component is created,
but an existing
dragDropEnd
event handler can always be changed or temporarily disabled,
which is what happens when
NULL,
is assigned to
dragDropEnd.
dragDropEnd
is always called when a drag and drop operation ends,
even if it was canceled when the user hit the
ESC
key.
The value stored in the
succeeded
field if its
event
argument will be
1
if the operation ended in a successful drop and
0
it failed.
If the drop was successful
dragDropEnd
sometimes checks the
action
field in
event
to see if the user wanted to
MOVE
the data, and if so
dragDropEnd
can choose to ignore the request or delete the data.
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,
dragEnter,
dragExit,
DragGestureEvent,
dragGestureRecognized,
dragMouseMoved,
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
|
|