File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difficulties with JPopupMenu

 
Shane Roylance
Ranch Hand
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am implementing a right mouse menu for an application I am working on. I have a mouse listener attatched to my JTable, and when the user clicks the right mouse button it calls this method:

This works great the first time the right mouse button is selected. BUT each time after that I get a flash of the menu, but it doesn't stay. It's like something is automatically deleting it. What am I missing here??
TIA
Shane
 
Shane Roylance
Ranch Hand
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I posted this a while back, and I still haven't found a resolution to this problem. I thought I would bring it up again to see if anyone has any input.
Thanks
Shane
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made some test code from your example... (posted below) and did not have the problem that you described... so the problem isn't in the code that you posted...

 
Shane Roylance
Ranch Hand
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I looked into it a little more, and I read through the java tutorial again. I changed my mouse listener, and I made it so my rmm was instantiated only once (then reused). This seems to fix the problems I was experiencing. I don't know why, but it does. :roll:
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic