Class StatusBar

  • All Implemented Interfaces:
    Styleable, EventTarget, Skinnable

    public class StatusBar
    extends Control
    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);
     
    • Constructor Detail

      • StatusBar

        public StatusBar()
        Constructs a new status bar control.
    • Method Detail

      • setText

        public final void setText​(String text)
        Sets the value of the textProperty().
        Parameters:
        text - the text shown by the label control inside the status bar
      • getText

        public final String getText()
        Returns the value of the textProperty().
        Returns:
        the text currently shown by the status bar
      • getGraphic

        public final Node getGraphic()
        Returns the value of the graphicProperty().
        Returns:
        the graphic node shown by the label inside the status bar
      • setGraphic

        public final void setGraphic​(Node node)
        Sets the value of graphicProperty().
        Parameters:
        node - the graphic node shown by the label inside the status bar
      • getStyleText

        public String getStyleText()
        A string representation of the CSS style associated with this Text. Node.getStyle()
        Returns:
        the style applied on the text.
      • getLeftItems

        public final ObservableList<Node> getLeftItems()
        Returns the list of items / nodes that will be shown to the left of the status label.
        Returns:
        the items on the left-hand side of the status bar
      • getRightItems

        public final ObservableList<Node> getRightItems()
        Returns the list of items / nodes that will be shown to the right of the status label.
        Returns:
        the items on the left-hand side of the status bar
      • progressProperty

        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.
        See Also:
        getProgress(), setProgress(double)
      • setProgress

        public final void setProgress​(double progress)
        Sets the value of the progressProperty().
        Parameters:
        progress - the new progress value
      • getProgress

        public final double getProgress()
        Returns the value of progressProperty().
        Returns:
        the current progress value
      • getUserAgentStylesheet

        protected final String getUserAgentStylesheet​(Class<?> clazz,
                                                      String fileName)
        A helper method that ensures that the resource based lookup of the user agent stylesheet only happens once. Caches the external form of the resource.
        Parameters:
        clazz - the class used for the resource lookup
        fileName - the name of the user agent stylesheet
        Returns:
        the external form of the user agent stylesheet (the path)