United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6315298 : Swing DnD - Cannot insert into empty tree folder.

Details
Type:
Bug
Submit Date:
2005-08-24
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2005-09-20
Component:
client-libs
OS:
generic
Sub-Component:
javax.swing
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Relates:

Sub Tasks

Description
4468566 added much better drop support to Swing components. While building demos for the JavaOne conference, I discovered a severe limitation with DropMode.INSERT in JTrees. If a folder node has no children, or is collapsed, it is impossible to insert an item into it.

In addition, I found a couple other small issues that should be addressed:

- We should support null for the "dropLineColor" and "dropLineShortColor" properties so that developers can use the UIManager to turn off the drop line indication.

- There is a minor bug with painting the drop line at the end of JTrees.

                                    

Comments
EVALUATION

The solution to the main problem is to allow dropping on top of folder nodes in INSERT mode.

To fix the null drop line color issue, we'll simply check for null before trying to draw the drop line.

The other bug that was mentioned with the drop line at the end of a tree will also be fixed.
                                     
2005-08-24
EVALUATION

I've also decided that allowing to drop as a peer to the root is nonsensical and I've removed this option.
                                     
2005-08-25



Hardware and Software, Engineered to Work Together