aspose 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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
 
Similar Threads
Can i use Menu & Menu options in applet?
Trouble with displaying fonts
collapsable list
Menu implementation in Struts2
calling a servlet by clicking a menu?