• Post Reply Bookmark Topic Watch Topic
  • New Topic

Selection highlight problems in TreeCellRenderer using trailing icons  RSS feed

 
Steve Jackson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got a TreeCellRenderer derived from DefaultTreeCellRenderer and I've run into trouble when I put the text before the icon. When I select in the tree, the drawn rectangle is shifted to the right (by the size of my icon) missing the beginning of the text and the rectangle overlaps the icon. I'd prefer if only the text was selected. The problem seems to be in a private method in DefaultTreeCellRenderer(called by paint), so I can't override, and obviously I could write an entire renderer, but I was hoping for a blindingly obvious solution I just don't see.



Thanks for your time.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!