Skip to content

Instantly share code, notes, and snippets.

@jagedn
Created April 2, 2017 10:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jagedn/3ebc5a11f16743c7362b836827ffe3ce to your computer and use it in GitHub Desktop.
Save jagedn/3ebc5a11f16743c7362b836827ffe3ce to your computer and use it in GitHub Desktop.
groovyfx as script
import groovy.grape.Grape
new javafx.embed.swing.JFXPanel();
Grape.grab(group:'org.groovyfx',module:'groovyfx',version:'8.0.0',transitive:false)
Class.forName('groovyx.javafx.GroovyFX').start {
stage(title: 'GroovyFX Hello World', visible: true) {
scene(fill: BLACK, width: 500, height: 250) {
hbox() {
text(text: 'Groovy', font: '80pt sanserif') {
fill linearGradient(endX: 0, stops: [PALEGREEN, SEAGREEN])
}
text(text: 'FX', font: '80pt sanserif') {
fill linearGradient(endX: 0, stops: [CYAN, DODGERBLUE])
effect dropShadow(color: DODGERBLUE, radius: 25, spread: 0.25)
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment