JDK-4519484 : Add TransferHandler support to top-level containers
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2001-10-25
  • Updated: 2017-05-16
  • Resolved: 2005-09-20
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.
6 b53Fixed
Name: gm110360			Date: 10/25/2001

java version "1.4.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b77)
Java HotSpot(TM) Client VM (build 1.4.0-beta2-b77, mixed mode)

I like the new Swing Data Transfer mechanism mechanism in the JDK 1.4 beta.
Unfortunately, I can't use it for my application, because I need to be able to
accept objects which are dropped anywhere at all - including objects dropped on
my frame's title bar.

Using the AWT drag and drop mechanism, I can implement what I need by creating
a DropTarget object and then calling setDropTarget() on my JFrame; this works
because JFrame ultimately inherits from java.awt.Component, which defines
setDropTarget().  I would love to use the new Swing Data Transfer mechanism
instead so that I wouldn't have to implement my own DropTarget object.  But I
can't, because JFrame doesn't inherit from JComponent and so I can't call
setTransferHandler() on a JFrame.  I could call setTransferHandler() on the
root pane, which is a JComponent - but that wouldn't accept objects dropped
onto the frame's title bar.

FYI, I'm using Windows 2000, although I suspect that this issue is platform-
(Review ID: 134445) 

EVALUATION Targeting this to Mustang. The fix will be to add set/getTransferHandler() methods to JFrame, JDialog, JWindow and JApplet. Unfortunately, TransferHandler's import/export methods are currently all typed to JComponent. As such, export ability will not be implemented at this time. However, 1.6 adds new canImport(TransferInfo) and importData(TransferInfo) methods, and the TransferInfos can be changed from supporting JComponent to supporting Component. As such, it will be easy to make data import work with these top-level components through those methods.

WORK AROUND Name: gm110360 Date: 10/25/2001 use AWT drag-and-drop rather than the new Swing Data Transfer mechanism ======================================================================

EVALUATION This is an interesting idea that deserves to be investigated further. ###@###.### 2001-11-14