开发者

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:

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜