File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JPopupMenu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JPopupMenu" Watch "JPopupMenu" New topic
Author

JPopupMenu

Mathews P Srampikal
Ranch Hand

Joined: Nov 26, 2002
Posts: 211
I have a JTable and on right clicking on a cell am poping up a JPopupMenu.This menu contains "One","Two","Three" as menu item.How to know which menu item was clicked.


Thanks,
Mathews
Sebastiaan Kortleven
Ranch Hand

Joined: Mar 12, 2004
Posts: 81
Add the items as JMenuItems.. you can add an actionListener to those JMenuItems...
gl
Mathews P Srampikal
Ranch Hand

Joined: Nov 26, 2002
Posts: 211
Thank You.One more problem.If i keep on rightclicking on the table that many popups are coming.How to avoid this.How do we make a color for the selected Item.like our IE right Click.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JPopupMenu