Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Generated Object

Specifies a node and properties for assigning a node to the center border region in a borderPane.


align the alignment within the region, values can either be a javafx.geometry.Pos object, or a string that maps the the enumerations defined for the Pos object. see javafx.geomety.Pos

margin the margin to surround the node within the borderPane region. This contains a javafx.geometry.Insets object, or a list of numbers that contain the top, right, bottom, and left margins. If only one number is provided then all sides of the margin will be set to that number. If 2 numbers are provided the top and bottom will use the first number and left and right will use the second number. see javafx.geometry.Insets


This node contains one javafx.scene.Node.


Sets the node at the center region of the borderPane.


Code Block
import groovyx.javafx.GroovyFX
import javafx.scene.paint.Color;
import groovyx.javafx.SceneGraphBuilder
import javafx.scene.control.*;

    def sg = new SceneGraphBuilder();

            title: "BorderPane Example (Groovy)",
            width: 650, height: 450,
            visible: true,
    ) {
        scene(fill: lightgreen) {
            borderPane() {
                top(align: "center", margin: [10, 0, 10, 0]) {
                    button(text: "top")
                right(align: "center", margin: 10) {
                    button(text: "right")
                left(align: "center", margin: [0, 10]) {
                    button(text: "left")
                bottom(align: "center", margin: [10, 0]) {
                    button(text: "bottom")
                center(align: "center") {
                    label(text: "center")