• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTree seems to handle text on Branches in a different way to that on Leaf nodes  RSS feed

 
Alison Rimmer
Greenhorn
Posts: 2
1
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JTree with a custom TreeNodeRenderer which under certain circumstances sets the text to Bold.

Branch nodes always have their full text displayed even when they are Bold, however when leaf nodes are set to Bold their text is truncated and an ellipses added.

Does anyone know why this happens, and if there is any way to prevent the Leaf nodes truncating their text (there is plenty of space for the text in the tree panel).
 
Alison Rimmer
Greenhorn
Posts: 2
1
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My search skill obviously need honing - the solution in this topic Truncation of text in JTree (set JTree to use large model) worked for me too.
 
Stephan van Hulst
Saloon Keeper
Posts: 7207
118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch, Alison!

I'm glad you managed to find a solution to your problem. Have a cow for sharing it with us.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!