• Post Reply Bookmark Topic Watch Topic
  • New Topic

Right Click Menu on a JList

 
Dave Donohoe
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi all - can anyone tell me the easiest way to add a Right Click Popup Menu onto the items in a JList?
Thanks,
D
 
ming fan
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add a mouse listener to the list, and in mouseClicked method detect for right mouse click, then decide whether should pop up the JPopupMenu or not.
Originally posted by Dave Donohoe:

Hi all - can anyone tell me the easiest way to add a Right Click Popup Menu onto the items in a JList?
Thanks,
D

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!