【发布时间】:2014-02-12 17:45:53
【问题描述】:
我正在尝试找出与 FXML AnchorPane.topAnchor(以及底部、右侧、左侧锚点)属性等效的 JavaFX API 调用。通常,FXML 属性似乎是对象上的属性,但似乎没有 AnchorPane 类型属性或任何其他返回此类对象的属性。
例如,如果我有以下 FXML
<BorderPane fx:id="borderPane" AnchorPane.bottomAnchor="4.0"
AnchorPane.leftAnchor="4.0"
AnchorPane.rightAnchor="4.0"
AnchorPane.topAnchor="30.0"> .... more FXML here
设置锚窗格锚点的相关 Java API 调用是什么?
例如
BorderPane borderPane = new BorderPane();
//
// What method calls on borderPane would set the anchors?
//
感谢任何指点。
- chooks
【问题讨论】:
-
AnchorPane documentation 会在 Anchor Constraints 部分告诉您如何执行此操作。