[java] 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

This question is related to java swing mouse right-click swingutilities

The answer is


Yes, take a look at this thread which talks about the differences between platforms.

How to detect right-click event for Mac OS

BUTTON3 is the same across all platforms, being equal to the right mouse button. BUTTON2 is simply ignored if the middle button does not exist.


I've seen

anEvent.isPopupTrigger() 

be used before. I'm fairly new to Java so I'm happy to hear thoughts about this approach :)


Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to swing

Calling another method java GUI Read input from a JOptionPane.showInputDialog box Call japplet from jframe Java JTable getting the data of the selected row What does .pack() do? How to add row of data to Jtable from values received from jtextfield and comboboxes How can I check that JButton is pressed? If the isEnable() is not work? Load arrayList data into JTable How to draw a circle with given X and Y coordinates as the middle spot of the circle? Simplest way to set image as JPanel background

Examples related to mouse

Determine which element the mouse pointer is on top of in JavaScript Change the mouse cursor on mouse over to anchor-like style Move the mouse pointer to a specific position? Copying text outside of Vim with set mouse=a enabled Java Mouse Event Right Click How to get mouse position in jQuery without mouse-events? Change background color on mouseover and remove it after mouseout How to disable mouse right click on a web page? Get Mouse Position Controlling mouse with Python

Examples related to right-click

Adding a right click menu to an item How to add a custom right-click menu to a webpage? Java Mouse Event Right Click Making custom right-click context menus for my web-app How to disable mouse right click on a web page? Right click to select a row in a Datagridview and show a menu to delete it right click context menu for datagridview How to distinguish between left and right mouse click with jQuery

Examples related to swingutilities

Java Mouse Event Right Click