diff --git a/java/awt/dnd/DropTargetContext.java b/java/awt/dnd/DropTargetContext.java index 4c21a6e8ad..aa778ffdcb 100644 --- a/java/awt/dnd/DropTargetContext.java +++ b/java/awt/dnd/DropTargetContext.java @@ -117,11 +117,18 @@ public void removeNotify() protected void setTargetActions(int actions) { targetActions = actions; + if (dtcp != null) + dtcp.setTargetActions(actions); } protected int getTargetActions() { - return targetActions; + // As in the JDK, the peer knows the actions; without one, use the + // drop target's default actions. + if (dtcp != null) + return dtcp.getTargetActions(); + return targetActions != 0 ? targetActions + : dropTarget.getDefaultActions(); } /**