Class ProgressBar

All Implemented Interfaces:
LayoutMeasurable, LayoutMeasurableMixin, HasBackgroundProperty, HasBlendModeProperty, HasBorderProperty, HasClipProperty, HasEffectProperty, HasHeightProperty, HasLayoutXProperty, HasLayoutYProperty, HasManagedProperty, HasMaxHeightProperty, HasMaxWidthProperty, HasMinHeightProperty, HasMinWidthProperty, HasMouseTransparentProperty, HasOnMouseClickedProperty, HasOpacityProperty, HasPaddingProperty, HasParentProperty, HasPrefHeightProperty, HasPrefWidthProperty, HasSnapToPixelProperty, HasVisibleProperty, HasWidthProperty, Styleable, EventTarget, Skinnable, INode, PreferenceResizableNode

public class ProgressBar extends ProgressIndicator
A specialization of the ProgressIndicator which is represented as a horizontal bar.

ProgressBar sets focusTraversable to false.

This first example creates a ProgressBar with an indeterminate value:

 ProgressBar p1 = new ProgressBar();
Image of the indeterminate progress ProgressBar control

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

 ProgressBar p2 = new ProgressBar();
 p2.setProgress(0.25F);
Image of the ProgressBar control
Since:
JavaFX 2.0
  • Constructor Details

    • ProgressBar

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

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

    • createDefaultSkin

      protected Skin<?> createDefaultSkin()
      Create a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS -fx-skin or set explicitly in a sub-class with setSkin(...).
      Overrides:
      createDefaultSkin in class ProgressIndicator
      Returns:
      new instance of default skin for this control. If null then the control will have no skin unless one is provided by css.