Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPopupMenu

 
Mathews P Srampikal
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sebastiaan Kortleven
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add the items as JMenuItems.. you can add an actionListener to those JMenuItems...
gl
 
Mathews P Srampikal
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic