...
| Code Block |
|---|
import groovyx.javafx.GroovyFX
import javafx.scene.paint.Color;
import groovyx.javafx.SceneGraphBuilder
import javafx.scene.control.*;
GroovyFX.start({
def def sg = new SceneGraphBuilder();
sg sg.stage(
title title: "AnchorPane Example (Groovy)",
width width: 650, height:450,
visible visible: true,
) {
scene(fill: lightgreen ) {
anchorPane() anchorPane {
button(text: "ONE", topAnchor: 10, bottomAnchor: 10,
rightAnchor rightAnchor: 110, leftAnchor: 10)
button(text: "TWO", rightAnchor: 10, topAnchor: 10)
}
}
}
});
|