Versions Compared

Key

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

Generated Object

javafx.scene.layout.AnchorPane

Attributes

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

Content

May contain  javafx Nodes. Each node may have attributes for topAnchor, bottomAnchor, leftAnchor and rightAnchor that contains a value representing the offset to the AnchorPane's edge.

Usage

Defines a container that lays out its children anchoring each node to the AnchorPane's edges.

Examples

Code Block
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: "AnchorPane Example (Groovy)",
        width: 650, height:450,
        visible: true,
    ) {
        scene(fill: lightgreen ) {
            anchorPane {
                button(text: "ONE", topAnchor: 10, bottomAnchor: 10,
                       rightAnchor: 110, leftAnchor: 10)
                button(text: "TWO", rightAnchor: 10, topAnchor: 10)
            }
        }
    }
});