1

I have created StatusBar in the following way:

    <StatusBar>
        <rightItems>
            <Label>Memory used: </Label>
            <TextField editable="false" fx:id="memoryUsedField"></TextField>
            <Label>MB</Label>
        </rightItems>
    </StatusBar>

and it looks like this actually:

enter image description here

I.e. Label is centered other way that TextField vertically.

How to fix?

Dims
  • 47,675
  • 117
  • 331
  • 600
  • did you try to use css? http://stackoverflow.com/questions/26530694/javafx-how-to-define-margin-to-textfield-in-css – Supahupe Aug 11 '16 at 12:27

1 Answers1

2

Not tested, but the status bar's leftItems and rightItems are implemented as HBoxs, so you can use HBox style properties for them. So try the following in an external style sheet:

.status-bar .right-items {
    -fx-alignment: center-right ;
}

( baseline-right might actually look better).

James_D
  • 201,275
  • 16
  • 291
  • 322