• Post Reply Bookmark Topic Watch Topic
  • New Topic

PopupMenu  RSS feed

 
Remi Dubey
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
namaste gurus,
i hv attached a popup menu to a Jdialog.
This popumenu shd pop up whn i right clk the mouse but in my case it pops up evn wth left click of a mouse.
i hv used pop.show( me.getComponent(), x, y); whr x = me.getX() and y = me.getY(). this code is wrtn in mousePressed()
whts the matter? pl. help...
 
PierreArnaud Galiana
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Remi, please have a look here:
How to Use Menus (go under the "Bringing up a popup menu" paragraph).
You'll see you have to use the isPopupTrigger() method of the MouseEvent to decide whether to call show() or not.
If you do not, then it happens on each mouse event...
'gld 2 hlp'...
[This message has been edited by PierreArnaud Galiana (edited June 25, 2001).]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!