发布于 2014-07-15 06:29:42
组件是跳转的,因为当您将text应用到Label时,StackPane的宽度会增加,而ProgressBar会转移到CENTER。
对于将来的引用,可以通过将样式应用于StackPane或任何其他布局来检查类似的现象。
<StackPane style=" -fx-border-color:black;
-fx-border-width: 1; -fx-border-style: solid;">为了避免这种情况,您必须将ProgressBar包装在一个HBox中并设置alignment of the HBox
...
<Label id="login-status-label" fx:id="loginStatusLabel" />
<HBox alignment="CENTER_RIGHT">
<ProgressIndicator id="login-status-progress-indicator"
fx:id="loginStatusProgressIndicator" prefHeight="15.0"
prefWidth="15.0" visible="false"/>
</HBox>
...https://stackoverflow.com/questions/24741607
复制相似问题