United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4464210 : RFE: for JTable drop targets, allow drop in enclosing JView

Details
Type:
Enhancement
Submit Date:
2001-05-30
Status:
Closed
Updated Date:
2001-11-14
Project Name:
JDK
Resolved Date:
2001-11-14
Component:
client-libs
OS:
generic
Sub-Component:
javax.swing
CPU:
generic
Priority:
P4
Resolution:
Won't Fix
Affected Versions:
1.4.0
Fixed Versions:

Related Reports
Relates:

Sub Tasks

Description

Name: bsC130419			Date: 05/30/2001


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

If I set a TransferHandler on a JTable I can drop items into it.  If the JTable is
in a JViewport that is larger then the JTable, a drop will only succeed if the
object is dropped on an existing table row.  To the user, this is unexpected
behavior.

Granted the workaround is simple, but each drag & drop developer will have to
discover the problem and remember the solution.  I think it is unlikley that a
developer would not want this behavior and if they did it'd be easy to remove.
(Review ID: 125344) 
======================================================================

                                    

Comments
WORK AROUND



Name: bsC130419			Date: 05/30/2001


Set the same TransferHandler on the JViewport as used on the JTable.  This can
be done in the configureEnclosingScrollPane() and setTransferHandler() methods.
======================================================================

It is also easy to avoid this by having the JTable automatically grow to fit the viewport. See JTable.getScrollableTracksViewportWidth() and JTable.getScrollableTracksViewportHeight(). 
###@###.### 2001-11-13

Note: 4310721 may actually change JTable.getScrollableTracksViewportHeight() to do what I've suggested.
###@###.### 2003-09-05
                                     
2001-11-13
EVALUATION

This is an interesting idea. However, it would be very difficult to fix. It would involve creating work-arounds for the DnD system such that a DnD operation occurring over one component (in this case the Viewport) could be retargeted at another component (in this case the JTable). DnD was not designed for this. This feature has received little interest from the development community and there are multiple work-arounds available. Will not fix.
###@###.### 2001-11-13

This may end up being fixed (at least partially) if and when 4310721 is addressed. The fix for that bug would ensure that the JTable was at least the size of the enclosing JViewport.
###@###.### 2003-09-05
                                     
2003-09-05



Hardware and Software, Engineered to Work Together