wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Difficulties with JPopupMenu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Difficulties with JPopupMenu" Watch "Difficulties with JPopupMenu" New topic
Author

Difficulties with JPopupMenu

Shane Roylance
Ranch Hand

Joined: Aug 29, 2001
Posts: 72
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

Joined: Aug 29, 2001
Posts: 72
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

Joined: Oct 18, 2000
Posts: 4121

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...



-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Shane Roylance
Ranch Hand

Joined: Aug 29, 2001
Posts: 72
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:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difficulties with JPopupMenu
 
Similar Threads
Default Popup menu....
JComboBox & JPopupMenu
scrollpane not scrolling
Popup on titlebar of JInternalFrame
Copy and paste popup menu