users
[Top] [All Lists]

Re: [cinjug-users] JTree and DND

To: "Brian Engel" <BEngel@xxxxxxxxxxxxx>, <users@xxxxxxxxxx>
Subject: Re: [cinjug-users] JTree and DND
From: "James Carman" <james@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 19 Jun 2003 09:28:50 -0400
Delivered-to: mailing list users@cinjug.org
Mailing-list: contact users-help@cinjug.org; run by ezmlm
References: <sef17d40.033@208.44.95.30>
Use the JTree.getPathForLocation(int x, int y) to figure it out.

----- Original Message ----- 
From: "Brian Engel" <BEngel@xxxxxxxxxxxxx>
To: <users@xxxxxxxxxx>
Sent: Thursday, June 19, 2003 9:06 AM
Subject: [cinjug-users] JTree and DND



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>
  • JTree and DND, Brian Engel
    • Re: [cinjug-users] JTree and DND, James Carman <=