How can I make right-clicks work on both NT and on a Macintosh? The Mac should work with control-click.
Created May 4, 2012
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(); }