Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript 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:

 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!