2014-02-12 35 views
0

我想弄清楚JavaFX API調用等效於FXML AnchorPane.topAnchor(和底部,右側,左側錨點)屬性。通常FXML屬性似乎是對象的屬性,但似乎沒有一個AnchorPane類型屬性或返回此類型對象的任何其他屬性。API版本AnchorPane.topAnchor FXML屬性?

舉例來說,如果我有以下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調用設置anchorpane錨?

例如

BorderPane borderPane = new BorderPane(); 
// 
// What method calls on borderPane would set the anchors? 
// 

感謝您的任何指示。

  • chooks
+0

的AnchorPane [文檔】(http://docs.oracle.com/javafx/2/api/javafx /scene/layout/AnchorPane.html)告訴你如何在** Anchor Constraints **部分下執行此操作。 – OttPrime

回答