Forum Discussion

tiffany_ip's avatar
tiffany_ip
Occasional Contributor
13 years ago

Method to get Contents in JTree

Hello,



I have a tree in my Java application (Swing Java JTree) that has nodes with names on them as identifiers (string format). Is there a way to retrieve all identifiers that are in the tree (either only visible or all of them)?



From Borland's testing software, they had a method called JTree.GetContents(); and it would get all the names.



I'm using JScript

4 Replies

  • tiffany_ip's avatar
    tiffany_ip
    Occasional Contributor
    I realized that there are several methods for a JTree object with FindChild, FindAll, FindAllChildren, but the nodes I have do not have properties and they're not recognized as objects - only the full tree is.



    Instead of selecting each item in the tree at a time to get their text, is there a simpler way to just get all the child text values?



    I'd appreciate if someone can answer this soon - *urgent*

  • Hi Tiffany,


     


    If my reply helped you, you can vote for it ;) (by clicking "Was this post helpful? - Yes" next to the reply).