当Stage可调整大小时,ButtonBar会更改位置

时间:2017-06-26 07:06:38

标签: javafx javafx-8

我有一个BoarderPane(装饰:UTILITY),其中带有两个按钮的ButtonBar被放到BOTTOM:

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ButtonBar?>
<?import javafx.scene.layout.BorderPane?>

<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="pw.yaps.client.jfx.view.SettingsViewController">
   <bottom>
      <ButtonBar BorderPane.alignment="CENTER">
        <buttons>
          <Button disable="true" mnemonicParsing="false" text="OK" />
            <Button cancelButton="true" mnemonicParsing="false" onAction="#handleCancelAction" text="Cancel" />
        </buttons>
         <padding>
            <Insets bottom="12.0" right="12.0" />
         </padding>
      </ButtonBar>
   </bottom>
</BorderPane>

当舞台不可调整大小时,布局如下:
enter image description here
但是当我设置它可调整大小时它看起来不同:
enter image description here

如何避免这种行为?

0 个答案:

没有答案
相关问题