• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DefaultTreeCellRenderer not highlighting TreeNode on right-click

 
Tom Katz
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using a renderer that extends DefaultTreeCellRenderer. When I left-click on a tree node, it becomes highlighted. But not on a right-click. At first I thought it was because the popupMenu was stealing the focus, but I took the menu code out and same results.

So, anyone know how to highlight a tree node when it's right-clicked?
 
Tom Katz
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Turns out, all I needed was this code in my MouseAdapter inner class:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic