...
| 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: "BorderPaneGridPane Example (Groovy)",
width: 650, height:450,
visible: true,
) {
scene(fill: lightgreen ) {
gridPane(hgap: 4, vgap: 4, padding: [18,18,18,18], alignment: "center", gridLinesVisible: true) {
label (text: "Name: ") {
constraint(row: 0, column: 0, halignment: "right")
}
label (text: "Jim Clarke") {
constraint(row: 0, column:1, columnSpan: 5,halignment: "left")
}
label (text: "Address:") {
constraint(row: 1, column:0, halignment: "right")
}
label (text: "123 Main St") {
constraint(row: 1,column:1, columnSpan: 5,halignment: "left")
}
label (text: "City:") {
constraint(row: 2,column:0, halignment: "right")
}
label (text: "Orlando") {
constraint(row: 2,column:1, halignment: "left")
}
label (text: "State:") {
constraint(row: 2,column:2, halignment: "right")
}
label (text: "FL") {
constraint(row: 2,column:3, halignment: "left", hgrow: "never")
}
label (text: "Zipcode:") {
constraint(row: 2,column:4, halignment: "right")
}
label (text: "32817") {
constraint(row: 2,column:5, halignment: "left", hgrow: "never")
}
button(text: "Register") {
constraint(row: 3,0,columnSpan: 6, halignment: "center")
}
row(index: 4) {
label (text: "one")
label (text: "two")
label (text: "three")
}
column(index: 6) {
label (text: "one")
label (text: "two")
label (text: "three")
}
}
}
});
|