Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPopupMenu inside a Jtree

 
Chris Heady
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was trying to put a popupMenu into a JTree, and I thought I had followed what most examples show, but my popupMenu never appears when I right click on the JTree. Also the isPopupTrigger is never true even when I use the other method (e.isPopupTrigger()). I have tried to add the popupMenu to the JTree as I have sometimes seen in examples but that did nothing. I also put the JTree into a scrollPane later on, would that affect anything? The pertinent code is below. Thanks for any help.

[ February 07, 2002: Message edited by: Chris Heady ]
[ February 07, 2002: Message edited by: Chris Heady ]
 
Chris Heady
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I actually found how to fix this. My main program had originally extended Applet, I decided to change to JApplet since most of my stuff was swing, and my popup just suddenly started working. I wonder why the Applet was letting me use swing components in the first place, most of the swing components worked, except for the popupMenu. Anyone know why this behavior exists?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic