Skip to content

Instantly share code, notes, and snippets.

@jagedn
Created April 2, 2017 10:09
Show Gist options
  • 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)
}
}
}
}
}
@ambastos
Copy link

I will try just to see if it works at least once! Thanks for the answer...

@ambastos
Copy link

Yes, I'll try a bit more, but it works only with java 8 and groovy 3. One version more, neither (java or groovy) works...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment