This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JPopupMenu
 
Similar Threads
collapsable list
calling a servlet by clicking a menu?
Can i use Menu & Menu options in applet?
Menu implementation in Struts2
Trouble with displaying fonts