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

Drag&Drop doesn't work for JTextComponent

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Build:
      b05
    • Introduced In Version:
    • Resolved In Build:
      b06
    • CPU:
      x86
    • OS:
      generic, windows_vista
    • Verification:
      Verified

      Backports

        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.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                dcherepanov Dmitry Cherepanov
                Reporter:
                dcherepanov Dmitry Cherepanov
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: