src/share/classes/javax/swing/TransferHandler.java
Print this page
*** 1266,1275 ****
--- 1266,1283 ----
if (listeners[i]==DropTargetListener.class) {
((DropTargetListener)listeners[i+1]).dragExit(e);
}
}
}
+ if (!isActive()) {
+ // If the Drop target is inactive the dragExit will not be dispatched to the dtListener,
+ // so make sure that we clean up the dtListener anyway.
+ DropTargetListener dtListener = getDropTargetListener();
+ if (dtListener != null && dtListener instanceof DropHandler) {
+ ((DropHandler)dtListener).cleanup(false);
+ }
+ }
}
public void drop(DropTargetDropEvent e) {
super.drop(e);
if (listenerList != null) {
*** 1556,1566 ****
}
handleDrag(e);
}
! private void cleanup(boolean forDrop) {
setComponentDropLocation(null, forDrop);
if (component instanceof JComponent) {
((JComponent)component).dndDone();
}
--- 1564,1574 ----
}
handleDrag(e);
}
! void cleanup(boolean forDrop) {
setComponentDropLocation(null, forDrop);
if (component instanceof JComponent) {
((JComponent)component).dndDone();
}