Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

Enumerating a JTree

Thread view: 
soup_or_power@yahoo.com - 21 Nov 2005 13:56 GMT
How can I list all the nodes in a JTree?

Thanks!
Roedy Green - 21 Nov 2005 16:27 GMT
On 21 Nov 2005 05:56:09 -0800, "soup_or_power@yahoo.com"
<soup_or_power@yahoo.com> wrote, quoted or indirectly quoted someone
who said :

>How can I list all the nodes in a JTree?

method 1.
find all the nodes in the root.  Then recursively call your function
on each of those nodes.

method 2,
read up on the visitor pattern.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Andrey Kuznetsov - 21 Nov 2005 17:29 GMT
DefaultMutableTreeNode#depthFirstEnumeration()
DefaultMutableTreeNode#breadthFirstEnumeration()

Signature

Andrey Kuznetsov
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.