users
[Top] [All Lists]

JTree and DND

To: <users@xxxxxxxxxx>
Subject: JTree and DND
From: "Brian Engel" <BEngel@xxxxxxxxxxxxx>
Date: Thu, 19 Jun 2003 09:06:35 -0400
Delivered-to: mailing list users@cinjug.org
Mailing-list: contact users-help@cinjug.org; run by ezmlm
I am trying to create a JTree which I can drag and drop one 
DefaultMutableTreeNode on top of another (with hopes of actually moving it 
there). 

I have figured out how to create a class that implements DropTargetListener and 
I can successfully "capture" events that JTree fires. What I want to know is 
there a way to figure out what object (DefaultMutableTreeNode, in this case) 
has been dropped on top of? 

i.e. I have a simple JTree like this....

Root
|
―--Child1
|              |----GrandChild1
|---Child2

I want to drag GrandChild1 and drop it on top of Root. I need to figure out 
(through the listener I suppose) what object was dropped on top of what. 
Primarily so I can rebuild the tree with GrandChild1 as a Child of Root. 


Do this make any sense :-) ?


Any help would be appreciated.....







<Prev in Thread] Current Thread [Next in Thread>