Link to home
Start Free TrialLog in
Avatar of msterjev
msterjev

asked on

JTree question

I have JTree which a fill with nodes at the first time.
After that a call removeAllChildren() method for some node and I am adding a brand new set of nodes as childrens for this node. Why the JTree doesn't changes? (There are only interrupted lines to previous childs which are still visible)!
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Sounds like your making calls on the tree node (as opposed to the model).
The tree node do not support firing TreeModelEvent's.
If you change your nodes you must also ensure that the matching events are fired by your tree model.
Avatar of msterjev
msterjev

ASKER

The events are minor problem. Give me example how to dinamically change structure of one node( remove all its childrens and add new ones)!
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial