How can I detect a right click of a mouse?

Sandip Chitale

public void mouseClicked(MouseEvent me)
  if (me.getModifiers() & BUTTON3_MASK != 0)
     // it is right mouse click
     // it assumes 123 mouse settings

If you want to really show the popup menu in response to right mouse click you should call use


from both mousePressed and mouseReleased to be truly platform independant.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact