My tree nodes are not displaying properly. The first time when i bring up the tree all nodes are dipalying properly.when i change the node object text programatically (more in length than the previous)it is displaying part of name and three dots. can please some one help in fixing this. Thanks
Your JavaRanch name needs to be changed. It's not really my job to tell you this, but there you go. The reason for the display is that tree nodes are actually JLabels, and those dots (aka an ellipsis ) are a "feature" of JLabel, when the JLabel is forced to occupy a smaller area than it would preffer. AFAIK JTree doesn't grow to accomodate long labels, so basically you may be screwed. Of course, you could always subclass JTree and override Component.getPreferredSize() to fix this. (Or you could write a Component listener to call JComponent.setPreferredSize()). But there may be some serious difficulties in doing this, as JTree rendering is anything but trivial, and such a scheme would probably have to go through the entire tree, making it expensive. While I doubt it, there might be something at: http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
Joined: Oct 21, 2002
Thanks for your time.Infact I found the solution for above problem by calling nodeChanged method on myTreeModel.Now tree labels shows Properly Thanks again [ November 05, 2002: Message edited by: kumar B ]
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: my Tree node labels are not displayed entirely.