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

IOException when dragging certain items from a JFileChooser into Windows Explorer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 8-pool
    • 7
    • client-libs
    • generic
    • generic

      SYNOPSIS
      --------
      IOException when dragging certain items from a JFileChooser into Windows Explorer

      OPERATING SYSTEM
      ----------------
      Reported on Windows Server 2008 SP1 and R2.
      Possibly other Windows version.

      FULL JDK VERSION
      ----------------
      JDK 7 (tested with b143)
      Java 6 (tested with 1.6.0_25)

      REPRODUCTION INSTRUCTIONS
      -------------------------
      1. Compile and run the attached testcase
      2. Navigate to "My Network Places" in the file list
      3. Open a Windows Explorer window, and navigate to a temporary folder
         (any folder will do)
      4. Drag an item from "My Network Places" in the JFileChooser and drop it
         into the Windows Explorer window

      (NOTE: Dragging from the "Libraries" location exposes the same issue.)

      Expected behaviour:
      Item should be copied, as it is when dragging/dropping between two native Explorer windows

      Actual behaviour:
      Item is not copied, and an IOException is printed on the console:

      java.io.IOException
              at sun.awt.datatransfer.DataTransferer.castToFiles(DataTransferer.java:1
      498)
              at sun.awt.datatransfer.DataTransferer.translateTransferable(DataTransfe
      rer.java:1316)
              at sun.awt.windows.WDataTransferer.translateTransferable(WDataTransferer
      .java:189)
              at sun.awt.datatransfer.DataTransferer$6.run(DataTransferer.java:2300)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:660)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
      ad.java:211)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
      java:128)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
      ad.java:117)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)

              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)

              at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)


      TESTCASE SOURCE
      ---------------
      import java.awt.*;
      import javax.swing.*;

      public class JFileChooserDnDSrc extends JFileChooser {
          public JFileChooserDnDSrc() {
              super();
              setDragEnabled(true);
          }

          public static void main(String[] args) {
              JFrame frame = new JFrame("JFileChooser");
              frame.getContentPane().add(new JFileChooserDnDSrc());
              frame.pack();
              frame.show();
          }
      }

            pchelko Petr Pchelko (Inactive)
            dkorbel David Korbel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: