Hi everyone,
I have a problem with JTree. I dynamically insert TreeNodes. Sometimes when I expand a node for the first time, there are no icons for the subnodes and leafs.
when i collapse end re-expand, then the icons are there but the horizontal size of the Label is not wide enough to fully write the nodes name.
So instand of
[ICON] Nodes name
there is:
[ICON] Nodes n...
The width for the label is obviously computed before the first time to show, without considering the icons width. When I after that collapse and expand the width is not wide enough for the icon AND the label.
This points to some mistake on inserting nodes or treating the tree the right way.
Has anyone experienced this problem and found out to avoid it ?
thanks for help in advance
janko
Michael Rauscher - 28 Jan 2004 16:33 GMT
Hi Janko,
Janko Dimitroff schrieb:
> Hi everyone,
>
[quoted text clipped - 16 lines]
>
> janko
After you've inserted some nodes into your TreeModel, you have to notify
the TreeModelListeners about these changes. JTree registers itself as
TreeModelListener at the TreeModel. All you have to do is to fire a
TreeModelEvent.
Bye
Michael