Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+11 votes
asked in CSC212_Spring2019 by (1 point)

2 Answers

+6 votes

In the program directions, we are told that MouseEvent.BUTTON1 is for a left click and MouseEvent.BUTTON3 is for a right click. So you check if your source is equal to MouseEvent.BUTTON1 or MouseEvent.BUTTON3. So you use event.getButton() to get the source.

answered by (1 point)
+1

Also, MouseEvent.BUTTON2 is the middle click.

+1 vote

You can use mouse event buttons and number them.

answered by (-499 points)
...