How can I make right-clicks work on both NT and on a Macintosh? The Mac should work with control-click.

Sandip Chitale

Check for isPopupTrigger() in mousePressed(MouseEvent e) as well as in mouseReleased(MouseEvent e).

Some platforms treat the "right-press" as the trigger for a popup menu, while others treat the "right-release" as the trigger. To be platform independent, you must check for right-clicks in both.


pubic void mousePressed(MouseEvent e) {
  if (e.isPopupTrigger())
    doRightClickThing();
}

pubic void mouseReleased(MouseEvent e) {
  if (e.isPopupTrigger())
    doRightClickThing();
}
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


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

 

 

About | Sitemap | Contact