JDK-4464210 : RFE: for JTable drop targets, allow drop in enclosing JView
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2001-05-30
  • Updated: 2001-11-14
  • Resolved: 2001-11-14
Related Reports
Relates :  
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
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
05-09-2003

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
13-11-2001