JDK-6834358 : Drag&Drop doesn't work for JTextComponent
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u10,6u14
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,windows_vista
  • CPU: x86
  • Submitted: 2009-04-27
  • Updated: 2011-01-19
  • Resolved: 2009-05-15
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.
JDK 6 JDK 7
6u14 b06Fixed 7Resolved
Related Reports
Relates :  
Relates :  
Description
Swing's regression test fails

test/javax/swing/DataTransfer/DnDAutoTests/Text/TextAutoTest.java

The cause of the failures is following.

This is a regression introduced by the changes for 6824169 (Need to remove some AWT class dependencies) fixed in 6u14 b05.

The fix for 6824169 replaces usages of the reflection API in the javax.swing.TransferHandler class with usages of the sun.swing.SwingAccessor$JComponentAccessor interface - the usages are the JTextComponent.dropLocationForPoint and JTextComponent.setDropLocation calls.

The methods in the JTextComponent class are meant to override appropriate methods in the JComponent class. But these methods in the JComponent class are package-private and the JTextComponent class don't override the methods (the location of the JTextComponent class is javax.swing.text package, not javax.swing package) and it's wrong to call the methods in the JTextComponent class using the SwingAccessor$JComponentAccessor interface.

The fix for the problem is to introduce new sun.swing.SwingAccessor$JTextComponentAccessor interface and access the methods in the JTextComponent class using the interface.

Comments
EVALUATION Another option is to roll back the fix for 6824169 partially. That is, to roll back the changes in Drag&Drop area in the Swing code. The risk of such changes is minimal.
27-04-2009

SUGGESTED FIX http://sa.sfbay.sun.com/projects/awt_data/6u14/6834358
27-04-2009

EVALUATION Need to be fixed.
27-04-2009