focusListener
Runs onFocusChange whenever the component takes or loses the keyboard focus. Read isFocusOwner to tell which, or declare the two directions separately.
onFocusChange is read when the event fires, so writing a fresh lambda on every recomposition registers nothing again.
Return
this chain with the focus callback declared on it.
Parameters
receives the event, whose oppositeComponent is the other side of the transfer and whose isTemporary marks a loss the component gets back, such as its window being deactivated.
See also
Runs onFocusGained when the component takes the keyboard focus and onFocusLost when it loses it. A direction 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 focus callbacks declared on it.
Parameters
runs once the component is the focus owner, so isFocusOwner already answers true.
runs once the focus has gone; a temporary loss, such as a window deactivating, reports here too.
See also
Attaches a FocusListener (addFocusListener/removeFocusListener).
Return
this chain with the focus 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.