Top Description Fields Constructors Methods
org.controlsfx.control

public Class StatusBar

extends ControlsFXControl
Class Inheritance
Static Imports
impl.org.controlsfx.i18n.Localization.asKey, .Localization.localize

The StatusBar control is normally placed at the bottom of a window. It is used to display various types of application status information. This can be a text message, the progress of a task, or any other kind of status (e.g. red / green / yellow lights). By default the status bar contains a label for displaying plain text and a progress bar (see ProgressBar) for long running tasks. Additional controls / nodes can be placed on the left and right sides (see getLeftItems() and getRightItems()).

Screenshots

The picture below shows the default appearance of the StatusBar control:
Screenshot of StatusBar

The following picture shows the status bar reporting progress of a task:
Screenshot of StatusBar 
reporting progress of a task

The last picture shows the status bar reporting progress, along with a couple of extra items added to the left and right areas of the bar:
Screenshot of StatusBar
reporting progress, along with a couple of extra items

Code Sample

StatusBar statusBar = new StatusBar();
statusBar.getLeftItems().add(new Button("Info"));
statusBar.setProgress(.5);

Field Summary

Modifier and TypeField and Description
private final ObjectProperty<Node>
private final ObservableList<Node>
private final DoubleProperty
private final ObservableList<Node>
private final StringProperty
private final StringProperty

Constructor Summary

AccessConstructor and Description
public
StatusBar()

Constructs a new status bar control.

Method Summary

Modifier and TypeMethod and Description
protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control.

public final Node

Returns:

the graphic node shown by the label inside the status bar
getGraphic
()

Returns the value of the graphicProperty().

public final ObservableList<Node>

Returns:

the items on the left-hand side of the status bar
getLeftItems
()

Returns the list of items / nodes that will be shown to the left of the status label.

public final double

Returns:

the current progress value
getProgress
()

Returns the value of progressProperty().

public final ObservableList<Node>

Returns:

the items on the left-hand side of the status bar
getRightItems
()

Returns the list of items / nodes that will be shown to the right of the status label.

public String

Returns:

the style applied on the text.
getStyleText
()

A string representation of the CSS style associated with this Text.

public final String

Returns:

the text currently shown by the status bar
getText
()

Returns the value of the textProperty().

public String
getUserAgentStylesheet()

Overrides javafx.scene.layout.Region.getUserAgentStylesheet.

An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method.

public final ObjectProperty<Node>

Returns:

the property used for storing a graphic node
graphicProperty
()

The property used to store a graphic node that can be displayed by the status label inside the status bar control.

public final DoubleProperty

Returns:

the property used to store the progress of a task
progressProperty
()

The property used to store the progress, a value between 0 and 1.

public final void
setGraphic(Node
the graphic node shown by the label inside the status bar
node
)

Sets the value of graphicProperty().

public final void
setProgress(double
the new progress value
progress
)

Sets the value of the progressProperty().

public void
setStyleText(String style)

A string representation of the CSS style associated with this Text.

public final void
setText(String
the text shown by the label control inside the status bar
text
)

Sets the value of the textProperty().

public final StringProperty

Returns:

the BooleanProperty associated with the style applied to the text.
styleTextProperty
()

Return the BooleanProperty associated with the style applied to the text.

public final StringProperty

Returns:

the text message property
textProperty
()

The property used for storing the text message shown by the status bar.

Inherited from org.controlsfx.control.ControlsFXControl:
getUserAgentStylesheet

Field Detail

graphicback to summary
private final ObjectProperty<Node> graphic
leftItemsback to summary
private final ObservableList<Node> leftItems
progressback to summary
private final DoubleProperty progress
rightItemsback to summary
private final ObservableList<Node> rightItems
styleTextPropertyback to summary
private final StringProperty styleTextProperty
textback to summary
private final StringProperty text

Constructor Detail

StatusBarback to summary
public StatusBar()

Constructs a new status bar control.

Method Detail

createDefaultSkinback to summary
protected Skin<?> createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Doc from javafx.scene.control.Control.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(...).

Annotations
@Override
getGraphicback to summary
public final Node getGraphic()

Returns the value of the graphicProperty().

Returns:Node

the graphic node shown by the label inside the status bar

getLeftItemsback to summary
public final ObservableList<Node> getLeftItems()

Returns the list of items / nodes that will be shown to the left of the status label.

Returns:ObservableList<Node>

the items on the left-hand side of the status bar

getProgressback to summary
public final double getProgress()

Returns the value of progressProperty().

Returns:double

the current progress value

getRightItemsback to summary
public final ObservableList<Node> getRightItems()

Returns the list of items / nodes that will be shown to the right of the status label.

Returns:ObservableList<Node>

the items on the left-hand side of the status bar

getStyleTextback to summary
public String getStyleText()

A string representation of the CSS style associated with this Text. Node#getStyle()

Returns:String

the style applied on the text.

getTextback to summary
public final String getText()

Returns the value of the textProperty().

Returns:String

the text currently shown by the status bar

getUserAgentStylesheetback to summary
public String getUserAgentStylesheet()

Overrides javafx.scene.layout.Region.getUserAgentStylesheet.

Doc from javafx.scene.layout.Region.getUserAgentStylesheet.

An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method. These styles are used in addition to whatever user-agent stylesheets are in use. This provides a mechanism for third parties to introduce styles for custom controls.

The URL is a hierarchical URI of the form [scheme:][//authority][path]. If the URL does not have a [scheme:] component, the URL is considered to be the [path] component only. Any leading '/' character of the [path] is ignored and the [path] is treated as a path relative to the root of the application's classpath.

Subclasses overriding this method should not assume any particular implementation approach as to the number and frequency with which it is called. For this reason, attempting any kind of dynamic implementation (i.e. returning different user agent stylesheet values) based on some state change is highly discouraged, as there is no guarantee when, or even if, this method will be called. Some JavaFX CSS implementations may choose to cache this response for an indefinite period of time, and therefore there should be no expectation around when this method is called.



package com.example.javafx.app;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class MyApp extends Application {

    @Override public void start(Stage stage) {
        Scene scene = new Scene(new Group());
        scene.getStylesheets().add("/com/example/javafx/app/mystyles.css");
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
For additional information about using CSS with the scene graph, see the CSS Reference Guide.
Annotations
@Override
graphicPropertyback to summary
public final ObjectProperty<Node> graphicProperty()

The property used to store a graphic node that can be displayed by the status label inside the status bar control.

Returns:ObjectProperty<Node>

the property used for storing a graphic node

progressPropertyback to summary
public final DoubleProperty progressProperty()

The property used to store the progress, a value between 0 and 1. A negative value causes the progress bar to show an indeterminate state.

Returns:DoubleProperty

the property used to store the progress of a task

setGraphicback to summary
public final void setGraphic(Node node)

Sets the value of graphicProperty().

Parameters
node:Node

the graphic node shown by the label inside the status bar

setProgressback to summary
public final void setProgress(double progress)

Sets the value of the progressProperty().

Parameters
progress:double

the new progress value

setStyleTextback to summary
public void setStyleText(String style)

A string representation of the CSS style associated with this Text.Node#setStyle(java.lang.String)

setTextback to summary
public final void setText(String text)

Sets the value of the textProperty().

Parameters
text:String

the text shown by the label control inside the status bar

styleTextPropertyback to summary
public final StringProperty styleTextProperty()

Return the BooleanProperty associated with the style applied to the text.

Returns:StringProperty

the BooleanProperty associated with the style applied to the text.

textPropertyback to summary
public final StringProperty textProperty()

The property used for storing the text message shown by the status bar.

Returns:StringProperty

the text message property