Selection highlight problems in TreeCellRenderer using trailing icons
posted 13 years ago
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.