V
Vincent H
Hi,
For a project I'm working on I'm building a GUI that uses a JTree. This tree represents groups of hardware. Each node
represents such a piece of hardware. The name that is presented by the node is either the ip-address or the name of the
system and possilby a different color when the system is on-line. To be able to do that I'm using my own
TreeCellRenderer. The grouping of systems is handled by a TreeModel I made.
Now when I detect that a system becomes on-line, I update the model and trigger the TreeModelListeners'
treeNodeChanged() methods. I can see the tree change but when the string presented is longer that the initial string it
is truncated (ellipses are shown). I can't figure out what I'm doing wrong here.
To actually show what I'm experiencing I've made a small demo app that presents the problem. The classes are attached.
On the GUI press the "Hit Me!" button to make a different team become the champion (yeah I had to find some kind of
example). To see the problem you have to expand all nodes before hitting the button.
Has anyone experienced this? Any suggestions how to resolve this elegantly?
Thanks!
Vincent Hartsteen
For a project I'm working on I'm building a GUI that uses a JTree. This tree represents groups of hardware. Each node
represents such a piece of hardware. The name that is presented by the node is either the ip-address or the name of the
system and possilby a different color when the system is on-line. To be able to do that I'm using my own
TreeCellRenderer. The grouping of systems is handled by a TreeModel I made.
Now when I detect that a system becomes on-line, I update the model and trigger the TreeModelListeners'
treeNodeChanged() methods. I can see the tree change but when the string presented is longer that the initial string it
is truncated (ellipses are shown). I can't figure out what I'm doing wrong here.
To actually show what I'm experiencing I've made a small demo app that presents the problem. The classes are attached.
On the GUI press the "Hit Me!" button to make a different team become the champion (yeah I had to find some kind of
example). To see the problem you have to expand all nodes before hitting the button.
Has anyone experienced this? Any suggestions how to resolve this elegantly?
Thanks!
Vincent Hartsteen