Children in Enumeration
I have a enumeration for elements in a JTree
When I find some specific element in this JTree, I want to check it's children. Do the method children() in a Enumeration check it's grandcildren too?
For example, let's supose this JTree, considering the identation as new levels of the tree:
- Fruits
- apple 开发者_运维技巧
- grape
- orange
- peach
- pineapple
- strawberry
- banana
If I get the children of grape, will I have just orange, peach and strawberry or will I get peach children (pineaple) too?
You would just get orange, peach and strawberry. As a side note for future reference, this kind of behavior is almost a de facto.
You will just have orange and peach - you would need to check them for their children (grandchildren of the original node).
Edit: As derivation noted, you will also get Strawberry as that is a first level child - but the grandchildren will not be included in the enumeration.
精彩评论