[be sure to tile the page <BuilderName>.<node> i.e., SwingBuilder.frame]

Generated Object

javafx.scene.layout.BorderPane

Attributes

This node accepts the attributes for a javafx.scene.layout.BorderPane class. See the JavaDoc for javafx.scene.layout.BorderPane.

Content

May contain a top, bottom, right, left, or center node. It may also contain a javafx Node that will be placed in the center region of the BorderPane.

Usage

Defines a container that lays out its children along  specified borders.

Examples

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

GroovyFX.start({
    def sg = new SceneGraphBuilder();

    sg.stage(
            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: [0, 10, 0, 1]) {
                    button(text: "right")
                }
                left(align: "center", margin: [0, 10]) {
                    button(text: "left")
                }
                bottom(align: "center", margin: [10, 0]) {
                    button(text: "bottom")
                }
                /** center example, either construct, center() or standalone node is treated the same.   **/
                //center(align: "center") {
                label(text: "center")
                //}
            }
        }
    }
});