• Post Reply Bookmark Topic Watch Topic
  • New Topic

DONE -> JTree items rendered with html tags

 
Jeronimo Backes
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to add a node to a JTree and make that node show the text with html tags properly rendered?

Example:

I create a JLabel t, with text "Node with: <html><b><font color=red> red color </font></b></html>"

So, the node in the tree must show, in black: "Node with:" and subsequently: "red color" in red and bold.

I created a TreeCellRenderer, but it isn�t working at all. It shows the text AND the tags, with no color.

Here's the incredible class:



Any help will be appreciated.
[ July 29, 2005: Message edited by: Jer�nimo Backes ]
 
Jeronimo Backes
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
THAT'S IT!!! I MADE IT!!!


 
Swati Udas
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show us a snapshot of how the tree now looks
 
Tad Dicks
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought JLabel's were supposed to be able to render html. I would think using a JEditorPane for each tree node would be "excessive" (I don't really know if that would cause any performance issues or otherwise though).

-Tad
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!