File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes actions .. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "actions .. " Watch "actions .. " New topic

actions ..

oLi Bou

Joined: Jul 03, 2002
Posts: 23
i have got a JScrollPane containing a JTree (i hardcoded a root node and it give me the children)
and I'd like to select some leafs(xml files) in my Tree and add these files as leafs of another JTree (in another JScrollPane). I'm using buttons to do this ...
So i'd like to select some leaf in my first JTree and these leafs being added to the other JTree when i press on the button
I've tried by myself (of course) and will continue but some help could be interesting

--learn every day--
Rene Liebmann
Ranch Hand

Joined: May 02, 2002
Posts: 196
Do you have a TreeModel? This would be the easiest way. Then you can easily detect all children of your selected tree and you deal only with data. It doesn't matter what kind of component is behind.
Maybe you can tell us a bit more in detail, what you already have. Maybe you give us a bit code. But pleas not the whole stuff, only the minimum.
I agree. Here's the link:
subject: actions ..
It's not a secret anymore!