Class BottomNavigationButton

  • All Implemented Interfaces:
    Styleable, EventTarget, Skinnable

    public class BottomNavigationButton
    extends Button

    Button to be used in BottomNavigation. By default, it has the style of a Material Design BottomNavigation button. Once selected, these buttons can only be de-selected by a click action event on another BottomNavigationButton. It is recommended to always have one button selected. When pressed or a click action is triggered, it will perform the same action irrespective of its current selection state.

    Screenshot of BottomNavigationButton

    Since:
    4.3.0
    See Also:
    BottomNavigation
    • Property Detail

      • selected

        public final BooleanProperty selectedProperty
        Specifies whether this BottomNavigationButton is currently selected.

        Style Guide:

        This property when set to true, adds a Pseudo-class "selected" to the button.
        Since:
        5.0.0
        See Also:
        isSelected(), setSelected(boolean)
    • Constructor Detail

      • BottomNavigationButton

        public BottomNavigationButton()
        Default constructor for BottomNavigationButton, creates one with an empty string as text and no graphic. The button will belong to a common ToggleGroup by default.
      • BottomNavigationButton

        public BottomNavigationButton​(String text)
        Creates a BottomNavigationButton with the text provided. The button will belong to a common ToggleGroup by default.
        Parameters:
        text - The text to show in the BottomNavigatioButton.
      • BottomNavigationButton

        public BottomNavigationButton​(String text,
                                      Node graphic)
        Creates a BottomNavigationButton with the text and graphic provided. The button will belong to a common ToggleGroup by default.
        Parameters:
        text - The text to show in the BottomNavigatioButton.
        graphic - The graphic to show in the BottomNavigationButton.
      • BottomNavigationButton

        public BottomNavigationButton​(String text,
                                      Node graphic,
                                      EventHandler<ActionEvent> actionEventEventHandler)
        Creates a BottomNavigationItem with the text and graphic provided.
        Parameters:
        text - The text to show in the BottomNavigationItem.
        graphic - The graphic to show in the BottomNavigationItem.
        actionEventEventHandler - The action to be performed by this BottomNavigationItem.
    • Method Detail

      • selectedProperty

        public final BooleanProperty selectedProperty()
        Specifies whether this BottomNavigationButton is currently selected.

        Style Guide:

        This property when set to true, adds a Pseudo-class "selected" to the button.
        Since:
        5.0.0
        See Also:
        isSelected(), setSelected(boolean)
      • isSelected

        public final boolean isSelected()
        Gets the value of the property selected.
        Property description:
        Specifies whether this BottomNavigationButton is currently selected.

        Style Guide:

        This property when set to true, adds a Pseudo-class "selected" to the button.
        Since:
        5.0.0
      • setSelected

        public final void setSelected​(boolean value)
        Sets the value of the property selected.
        Property description:
        Specifies whether this BottomNavigationButton is currently selected.

        Style Guide:

        This property when set to true, adds a Pseudo-class "selected" to the button.
        Since:
        5.0.0