Class Button


  • public final class Button
    extends SingleRowSection
    A focusable button that runs its action on ENTER or SPACE and is drawn reversed while focused.
    • Constructor Detail

      • Button

        public Button​(java.lang.String label)
        Creates a button with the given label.
        Parameters:
        label - the label text; treated as empty if null
    • Method Detail

      • setLabel

        public Button setLabel​(java.lang.String label)
        Sets the button's label.
        Parameters:
        label - the label text; treated as empty if null
        Returns:
        this Button for chaining
      • onActivate

        public Button onActivate​(java.lang.Runnable handler)
        Sets the action run when the button is activated.
        Parameters:
        handler - the activation handler
        Returns:
        this Button for chaining
      • style

        public Button style​(Style style)
        Sets the style used when the button is not focused.
        Parameters:
        style - the unfocused style
        Returns:
        this Button for chaining
      • focusedStyle

        public Button focusedStyle​(Style style)
        Sets the style used when the button is focused.
        Parameters:
        style - the focused style
        Returns:
        this Button for chaining