About MouseListener

How can I respond to the event of clicking with the RIGHT button of the mouse.

I already have a MouseListener set up, but the MouseEvent it give me does not have any means to find out if the user clicked with the right button or with the left button.

Any way to do this?????????????

Thanks in advance.
LVL 1
dyma82Asked:
Who is Participating?
 
rkenworthyConnect With a Mentor Commented:
Source code from javax.swing.SwingUtilities:

    public static boolean isRightMouseButton(MouseEvent anEvent) {
        return ((anEvent.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK);
    }
0
 
kylarCommented:
Also, if you want to make a popup menu there is always the isPopupTrigger() call.

Cheers,
Kylar

0
 
NetminderCommented:
0
 
NetminderCommented:
Admin notified of User neglect. Force-accepted by
Netminder
Community Support Moderator
Experts Exchange
0
All Courses

From novice to tech pro — start learning today.