How to add child on leaf node

asked 2016-02-03 09:30:44 +0800

Neus gravatar image Neus
1415 14

updated 2016-02-03 11:22:19 +0800


I have a tree that is build on the fly. At the beginning it may have leaf nodes that will have children later. But when I try to add children to leaf node it throws an UnsupportedOperationException. So...how can I convert a leaf node to a node that can contain children??

Thank you very much!

delete flag offensive retag edit


Hello Neus! when you say "build on the fly", i don't understand if you are using the tree model or you are instantiating treechildren-treeitem-treerow-treecell manually... can you show me some code or give more details?

gganassin ( 2016-02-17 11:29:46 +0800 )edit

I'm using a tree model. I mean that I have a tree with an especific tree model, and this first tree model have som leaf nodes with no children. But later I have to add a child to a leaf node. Then is when UnsupportedOperationException is thrown. I will try to write some sample code for you....

Neus ( 2016-02-19 12:50:30 +0800 )edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2016-02-03 09:30:44 +0800

Seen: 12 times

Last updated: Feb 03 '16

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More