Button
A JButton push button labeled text, which calls onClick each time the button is activated. Activation is an event and nothing more: the button carries no value for the caller to hold.
Parameters
the text to display on the button
callback to be invoked when the button is clicked
the SwingModifier applied to the underlying component
the SwingStyle applied to the underlying component
See also
A Button driven by a raw ActionListener instead of an onClick lambda.
The actionListener is attached as-is and removed on the same instance; pass a stable instance (e.g. remember {}) to avoid a detach/re-attach on every recomposition.
Parameters
the text to display on the button
the listener notified when the button is activated
the SwingModifier applied to the underlying component
the SwingStyle applied to the underlying component