This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JTree node names not visible Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTree node names not visible" Watch "JTree node names not visible" New topic
Author

JTree node names not visible

Paul Hudson
Greenhorn

Joined: Oct 18, 2011
Posts: 2
Hello there...!
I've written a JTree with couple of nodes. When I launch the program, I only see the node icons like folder or file and not the names associated with them. I could expand and collapse the nodes. When I debug, I see that the nodes are set with proper data whatever I used while building the model. In this program, i've written wrappers for JTree, TreeModel, DefaultMutableTreeNode. What could be the problem? Any pointers would be of great help.
-Paul
Paul Hudson
Greenhorn

Joined: Oct 18, 2011
Posts: 2
I've found the issue. I didn't override the toString() method of the user object class. That was null. I just learnt that it needs to be overridden.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTree node names not visible
 
Similar Threads
Searching a JTree
JTree with checkbox
JTree
JTree - Compare Nodes problem
JTree