5.9a how can I determine which button the user presses on the mouse? <Br>
<Br>
<Br>
A. refer to the following example: <br>
Public void mouseClicked (MouseEvent e) {<br>
<Br>
If (e. getModifiers () = MouseEvent. button#mask) {<br>
System. out. println (& quot; you clicked the mouse's first button! & Quot;); <br>
} <Br>
If (e. getModifiers () = MouseEvent. BUTTON2_MASK) {<br>
System. out. println (& quot; you clicked the second button of the mouse! & Quot;); <br>
} <Br>
If (e. getModifiers () = MouseEvent. BUTTON3_MASK) {<br>
System. out. println (& quot; you clicked the third button of the mouse! & Quot;); <br>
} <Br>
} <Br>
<Br>
Generally, the first button refers to the button used for & quot; Select & quot;, and the second button depends on different platforms, some systems do not provide these two buttons to the user. Therefore, the programmer must carefully consider the absence of these two buttons. <br>
<Br>