File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DefaultTreeCellRenderer not highlighting TreeNode on right-click

 
Tom Katz
Ranch Hand
Posts: 169
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Turns out, all I needed was this code in my MouseAdapter inner class:
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic