This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "java" Watch "java" New topic
Author

java

nerella kiran
Greenhorn

Joined: Nov 27, 2000
Posts: 1
how to recognize between the right and left click of the mouse button???
if any one knows the answer please mail back immediately cc to pmiriyala@yahoo.com
Warren Bell
Ranch Hand

Joined: Dec 20, 2000
Posts: 56
Check out the method isPopupTrigger() in MouseEvent or getModifiers() and BUTTON3_MASK or BUTTON2_MASK in InputEvent.
First Example:
if(e.isPopupTrigger())
// Code to display a pop-up menu or what ever you want to do.
// This is more platform independent.
Second Example:
if((e.getModifiers() & e.BUTTON3_MASK) != 0)
// Code to display a pop-up menu or what ever you want to do.
// This is more platform dependant.
Hope this helps

------------------
Warren Bell


Warren Bell
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java