Class ProgressIndicator

  • All Implemented Interfaces:
    Styleable, EventTarget, Skinnable
    Direct Known Subclasses:
    ProgressBar

    public class ProgressIndicator
    extends Control
    A circular control which is used for indicating progress, either infinite (aka indeterminate) or finite. Often used with the Task API for representing progress of background Tasks.

    ProgressIndicator sets focusTraversable to false.

    This first example creates a ProgressIndicator with an indeterminate value :

    
     import javafx.scene.control.ProgressIndicator;
     ProgressIndicator p1 = new ProgressIndicator();
     

    This next example creates a ProgressIndicator which is 25% complete :

    
     import javafx.scene.control.ProgressIndicator;
     ProgressIndicator p2 = new ProgressIndicator();
     p2.setProgress(0.25F);
     
    Implementation of ProgressIndicator According to JavaFX UI Control API Specification
    Since:
    JavaFX 2.0
    • Property Detail

      • indeterminate

        public final ReadOnlyBooleanProperty indeterminateProperty
        A flag indicating whether it is possible to determine the progress of the ProgressIndicator. Typically indeterminate progress bars are rendered with some form of animation indicating potentially "infinite" progress.
        See Also:
        isIndeterminate()
      • progress

        public final DoubleProperty progressProperty
        The actual progress of the ProgressIndicator. A negative value for progress indicates that the progress is indeterminate. A positive value between 0 and 1 indicates the percentage of progress where 0 is 0% and 1 is 100%. Any value greater than 1 is interpreted as 100%.
        See Also:
        getProgress(), setProgress(double)
    • Constructor Detail

      • ProgressIndicator

        public ProgressIndicator()
        Creates a new indeterminate ProgressIndicator.
      • ProgressIndicator

        public ProgressIndicator​(double progress)
        Creates a new ProgressIndicator with the given progress value.
        Parameters:
        progress - the progress, represented as a value between 0 and 1
    • Method Detail

      • isIndeterminate

        public final boolean isIndeterminate()
        Gets the value of the property indeterminate.
        Property description:
        A flag indicating whether it is possible to determine the progress of the ProgressIndicator. Typically indeterminate progress bars are rendered with some form of animation indicating potentially "infinite" progress.
      • indeterminateProperty

        public final ReadOnlyBooleanProperty indeterminateProperty()
        A flag indicating whether it is possible to determine the progress of the ProgressIndicator. Typically indeterminate progress bars are rendered with some form of animation indicating potentially "infinite" progress.
        See Also:
        isIndeterminate()
      • setProgress

        public final void setProgress​(double value)
        Sets the value of the property progress.
        Property description:
        The actual progress of the ProgressIndicator. A negative value for progress indicates that the progress is indeterminate. A positive value between 0 and 1 indicates the percentage of progress where 0 is 0% and 1 is 100%. Any value greater than 1 is interpreted as 100%.
      • getProgress

        public final double getProgress()
        Gets the value of the property progress.
        Property description:
        The actual progress of the ProgressIndicator. A negative value for progress indicates that the progress is indeterminate. A positive value between 0 and 1 indicates the percentage of progress where 0 is 0% and 1 is 100%. Any value greater than 1 is interpreted as 100%.
      • progressProperty

        public final DoubleProperty progressProperty()
        The actual progress of the ProgressIndicator. A negative value for progress indicates that the progress is indeterminate. A positive value between 0 and 1 indicates the percentage of progress where 0 is 0% and 1 is 100%. Any value greater than 1 is interpreted as 100%.
        See Also:
        getProgress(), setProgress(double)
      • getInitialFocusTraversable

        protected Boolean getInitialFocusTraversable()
        Returns the initial focus traversable state of this control, for use by the JavaFX CSS engine to correctly set its initial value. This method is overridden as by default UI controls have focus traversable set to true, but that is not appropriate for this control.
        Overrides:
        getInitialFocusTraversable in class Control
        Returns:
        the initial focus traversable state of this control
        Since:
        9