Right clicking with MouseListener

Is there any way to get MouseListeener to tell you wheather a click was right or left, it seems to treat them exacsly the same, but you can find out if Alt, Ctrl, or Shift is down, but finding out if it was a right-click would be much nicer than having to Alt-Click.
[280 byte] By [AnyoneEB] at [2007-9-26 2:38:39]
# 1

public void mouseClicked(MouseEvent event)

{

if((event.getModifiers() & event.BUTTON1_MASK)!=0)

//left clicked actions

elseif((event.getModifiers() & event.BUTTON3_MASK)!=0)

//right clicked actions

}

that works and it is similar to the code of isShiftDown() method and other is*Down() methods

of InputEvent class

I hope it helps

98028140 at 2007-6-29 10:09:51 > top of Java-index,Desktop,Core GUI APIs...
# 2
Thanks it works!
AnyoneEB at 2007-6-29 10:09:51 > top of Java-index,Desktop,Core GUI APIs...