Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Want to display Italic text in JTree...sometimes.  RSS feed

 
Patrick Girard
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok well i have a class extending JTree ...all works well but now i wanna display the node text in Italic or Bold depending on the state of the node...its a tree that i build from a database.
------------------
 
Haining Mu
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use DefaultTreeCellRenderer with method setFont.
something liek this:

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!