Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6941574

1.6.0_19 Update doesn't allow unsigned Applets to be Drag and Drop target

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 6u19
    • deploy
    • x86
    • windows_vista

      FULL PRODUCT VERSION :
      JRE version 1.6.0_19-b04

      ADDITIONAL OS VERSION INFORMATION :
      Windows Vista Home Basic

      EXTRA RELEVANT SYSTEM CONFIGURATION :

      A DESCRIPTION OF THE PROBLEM :
      An applet (drag source) can't transfer data to another one (drop target) via Drag and Drop.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Implement an Applet that receives DnD content, display it in a browser and Drag and Drop any appropriate object on to it.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The applet receives Drag and Drop content.
      ACTUAL -
      Since update 1.6.0_19 drop security exception is raised.


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Exception in thread "AWT-EventQueue-8" java.security.AccessControlException: access denied
       (java.awt.AWTPermission accessClipboard)
              at java.security.AccessControlContext.checkPermission(Unknown Source)
              at java.security.AccessController.checkPermission(Unknown Source)
              at java.lang.SecurityManager.checkPermission(Unknown Source)
              at java.lang.SecurityManager.checkSystemClipboardAccess(Unknown Source)
              at sun.awt.dnd.SunDropTargetContextPeer.getTransferData(Unknown Source)
              at sun.awt.datatransfer.TransferableProxy.getTransferData(Unknown Source)
              at java.awt.dnd.DropTargetContext$TransferableProxy.getTransferData(Unknown Source)
              ...


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;
      import java.awt.dnd.*;
      import java.awt.datatransfer.*;

      public class DndApplet extends javax.swing.JApplet {
          public void init() {
      DropTarget dt = new DropTarget(this, new DropTargetAdapter() {
      public void drop(DropTargetDropEvent dtde) {
      Transferable transferable = dtde.getTransferable();
      DataFlavor[] flavors = transferable.getTransferDataFlavors();
      for(int i=0; i < flavors.length; i++) {
      DataFlavor flavor = flavors[i];
           Class repClass = flavor.getRepresentationClass();
      if (repClass.equals(String.class)) {
                   dtde.acceptDrop(dtde.getSourceActions());
      try {
      Object object = transferable.getTransferData(flavor);
      System.out.println("Accepted string "+object);
      return;
      }
      catch (Exception ex) {
      ex.printStackTrace();
           }
      }
           }
      dtde.rejectDrop();
      }
      });
          }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      No Workaround.
      This doesn't work even if the drag source is another applet located at the same codebase.

      Release Regression From : 6u18
      The above release value was the last known release where this
      bug was not reproducible. Since then there has been a regression.

            ccheung Calvin Cheung
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: