Interface Toggle

  • All Known Implementing Classes:
    RadioButton, RadioMenuItem, ToggleButton

    public interface Toggle
    Represents a control that can be toggled between selected and non-selected states. In addition, a Toggle can be assigned a ToggleGroup, which manages all assigned Toggles such that only a single Toggle within the ToggleGroup may be selected at any one time.
    Since:
    JavaFX 2.0
    • Method Detail

      • isSelected

        boolean isSelected()
        Indicates whether this Toggle is selected.
        Returns:
        true if this Toggle is selected.
      • setSelected

        void setSelected​(boolean selected)
        Sets this Toggle as selected or unselected.
        Parameters:
        selected - true to make this Toggle selected.
      • getUserData

        Object getUserData()
        Returns a previously set Object property, or null if no such property has been set using the Node.setUserData(java.lang.Object) method.
        Returns:
        The Object that was previously set, or null if no property has been set or if null was set.
      • setUserData

        void setUserData​(Object value)
        Convenience method for setting a single Object property that can be retrieved at a later date. This is functionally equivalent to calling the getProperties().put(Object key, Object value) method. This can later be retrieved by calling Node.getUserData().
        Parameters:
        value - The value to be stored - this can later be retrieved by calling Node.getUserData().
      • getProperties

        ObservableMap<Object,​Object> getProperties()
        Returns an observable map of properties on this toggle for use primarily by application developers.
        Returns:
        An observable map of properties on this toggle for use primarily by application developers