Created
April 2, 2017 10:09
-
-
Save jagedn/3ebc5a11f16743c7362b836827ffe3ce to your computer and use it in GitHub Desktop.
groovyfx as script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} | |
} | |
} | |
} | |
} |
pffff 7 years ago it did ;)
yes, still works but you need to use very old versions of java+groovy
sdk install java 8.0.422.fx-zulu
sdk use java 8.0.422.fx-zulu
sdk install groovy 3.0.11
sdk use groovy 3.0.11
groovy run hello.groovy
don't know your idea/requirements but GroovyFX is not maintained (last commit was 3 years ago...)
I will try just to see if it works at least once! Thanks for the answer...
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
Hello. I'm sorry to bother you, but this code example is funcional? Because I have a hard time to run GroovyFx in my application. It still works?