JDK-7171812 : [macosx] Views keep scrolling back to the drag position after DnD
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7u4
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86
  • Submitted: 2012-05-25
  • Updated: 2013-06-26
  • Resolved: 2012-09-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
7u10Fixed 8Fixed
Related Reports
Duplicate :  
Relates :  
Views and Palette keeps scrolling back to the drag position after DnD.
Reported only with 7u4 on Mac.

In NetBeans, after dragging and dropping something from Projects or Files Views or Palette in GUI designers, when you scroll the View or Palette up/down, it keeps scrolling itself back to the drag position, making it impossible to select nodes/components not visible without scrolling to them.


Debugging revealed that the scrolling is caused by java.awt.dnd.DropTarget.DropTargetAutoScroller. This class is responsible for scrolling a tree/list when something is dragged over it. For some reason the timer isn't reset when the item is dropped or the drag is aborted. Seems like JDK bug since it works fine in other JDK versions.
I've created a sample application that demonstrates the problem. The application uses AWT implementation of DND and runs fine under JDK 1.6

Verified with 7u40b28 and regression test (see comments)

regression test failure info from JDK-2223208: closed/java/awt/dnd/AutoscrollStopTest/AutoscrollStopTest.html log: ----------System.out:(0/0)---------- ----------System.err:(20/1357)---------- java.lang.RuntimeException: Test failed at AutoscrollStopTest.autoscroll(AutoscrollStopTest.java:129) at java.awt.dnd.DropTarget$DropTargetAutoScroller.actionPerformed(DropTarget.java:733) at javax.swing.Timer.fireActionPerformed(Timer.java:312) at javax.swing.Timer$DoPostEvent.run(Timer.java:244) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:682) at java.awt.EventQueue$3.run(EventQueue.java:680) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:691) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) STATUS:Failed.Applet thread threw exception: java.lang.RuntimeException: Test failed result: Failed. Execution failed: Applet thread threw exception: java.lang.RuntimeException: Test failed test result: Failed. Execution failed: Applet thread threw exception: java.lang.RuntimeException: Test failed

EVALUATION The unexpected dragEntered event breaks timer of the autoscroller.