mouseListener
Runs onMouseEvent for every mouse event on the component - a click, a press, a release, the pointer entering and the pointer leaving alike, so one interaction reports more than once. Declare the events one by one to tell them apart.
onMouseEvent is read when the event fires, so writing a fresh lambda on every recomposition registers nothing again.
Return
this chain with the mouse callback declared on it.
Parameters
receives the event, whose id tells the five apart; a disabled component reports them too, since it is Swing's own listeners that check isEnabled.
See also
Runs each lambda on the mouse event it is declared for. An event left undeclared reports nowhere.
Each lambda is read when its event fires, so writing a fresh one on every recomposition registers nothing again.
Declaring none at all is refused.
Return
this chain with the mouse callbacks declared on it.
Parameters
runs on a release over the component the press went to; a drag in between can suppress it. clickCount is 2 on the second event of a double click.
runs when a button goes down; read isPopupTrigger here and on the release, since the platform decides which of the two carries it.
runs when the button comes back up, wherever the pointer is by then.
runs when the pointer moves onto the component.
runs as soon as the pointer leaves, a drag that began here included; the drag itself keeps reporting through mouseMotionListener until the button comes up.
See also
Attaches a MouseListener (addMouseListener/removeMouseListener).
Return
this chain with the mouse listener declared on it.
Parameters
attached by identity, so a remembered instance stays put while a fresh one on every pass is detached and re-added.