Java Mouse Event Right Click
问题 On my three button mouse MouseEvent.BUTTON2 = Middle Click and MouseEvent.BUTTON3 = Right Click. Is this the case on a two button mouse? Thanks 回答1: To avoid any ambiguity, use the utilities methods from SwingUtilities : SwingUtilities.isLeftMouseButton(MouseEvent anEvent) SwingUtilities.isRightMouseButton(MouseEvent anEvent) SwingUtilities.isMiddleMouseButton(MouseEvent anEvent) 回答2: Yes, take a look at this thread which talks about the differences between platforms. How to detect right