United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6834358 Drag&Drop doesn't work for JTextComponent
JDK-6834358 : Drag&Drop doesn't work for JTextComponent

Details
Type:
Bug
Submit Date:
2009-04-27
Status:
Closed
Updated Date:
2011-01-19
Project Name:
JDK
Resolved Date:
2009-05-15
Component:
client-libs
OS:
windows_vista,generic
Sub-Component:
java.awt
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u10,6u14
Fixed Versions:
6u14 (b06)

Related Reports
Backport:
Relates:
Relates:

Sub Tasks

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

Need to be fixed.
                                     
2009-04-27
SUGGESTED FIX

http://sa.sfbay.sun.com/projects/awt_data/6u14/6834358
                                     
2009-04-27
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.
                                     
2009-04-27



Hardware and Software, Engineered to Work Together