boolean (DnDTarget target, JComponent targetComponent) { DnDEvent currentDnDEvent = myLastProcessedEvent; if (currentDnDEvent == null) { return true; } if (target != null && targetComponent != null) { Component eachParent = targetComponent; while (eachParent != null) { if (target.equals(getTarget(eachParent))) { return true; } eachParent = eachParent.getParent(); } } return false; }