United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4519484 Add TransferHandler support to top-level containers
JDK-4519484 : Add TransferHandler support to top-level containers

Details
Type:
Enhancement
Submit Date:
2001-10-25
Status:
Resolved
Updated Date:
2006-09-13
Project Name:
JDK
Resolved Date:
2005-09-20
Component:
client-libs
OS:
generic
Sub-Component:
javax.swing
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.4.0
Fixed Versions:

Related Reports

Sub Tasks

Description
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-
independent.
(Review ID: 134445) 
======================================================================

                                    

Comments
EVALUATION

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



Name: gm110360			Date: 10/25/2001


use AWT drag-and-drop rather than the new Swing Data Transfer mechanism
======================================================================
                                     
2004-09-25
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.
                                     
2005-09-06



Hardware and Software, Engineered to Work Together