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

Drag and drop is raising exception for JList

XMLWordPrintable

    • beta
    • generic, x86, sparc
    • generic, solaris_2.6, windows_nt
    • Verified

      Drag and drop operation from JList to JTextField raising exceptions.

      In solaris, it is not at all copying the text of selected item of JList.

      In windows, it is copying but still throwing exceptions. But it is copying only after requesting focus for the JTextField before doing drag and drop operation.

      Find attached test case with the bug report.

      To Reproduce the bug :

      1) Compile and run the attached Java File.
      2) Select any item in the JList. Drag it to JTextField beside it. You'll be getting exceptions on console. No text copied into the textfield.
      3) Rerun it again, first select the JTextField, then do step 2. It copies the text into the textfield, but still raises exception.

      -----------------------------------------------
      stack trace found on Windows:
      Exception occurred during event dispatching:
      java.awt.dnd.InvalidDnDOperationException: The operation requested cannot be per
      formed by the DnD system since it is not in the appropriate state
              at sun.awt.dnd.SunDropTargetContextPeer.setCurrentJVMLocalSourceTransfer
      able(SunDropTargetContextPeer.java:114)
              at sun.awt.windows.WDragSourceContextPeer.startDrag(WDragSourceContextPe
      er.java:82)
              at java.awt.dnd.DragSource.startDrag(DragSource.java:267)
              at java.awt.dnd.DragSource.startDrag(DragSource.java:366)
              at java.awt.dnd.DragGestureEvent.startDrag(DragGestureEvent.java:187)
              at javax.swing.TransferHandler$DragHandler.dragGestureRecognized(Transfe
      rHandler.java:601)
              at java.awt.dnd.DragGestureRecognizer.fireDragGestureRecognized(DragGest
      ureRecognizer.java:334)
              at javax.swing.TransferHandler$SwingDragGestureRecognizer.gestured(Trans
      ferHandler.java:653)
              at javax.swing.TransferHandler.exportAsDrag(TransferHandler.java:130)
              at javax.swing.plaf.basic.BasicListUI$MouseInputHandler.mouseDragged(Bas
      icListUI.java:851)
              at java.awt.Component.processMouseMotionEvent(Component.java:4183)

            dassunw Das Das (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: