-
-
Save crazy4groovy/2293137 to your computer and use it in GitHub Desktop.
A basic GroovyFX HelloWorld program
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
@Grab('org.codehaus.groovyfx:groovyfx:0.1') | |
import groovyx.javafx.GroovyFX | |
import groovyx.javafx.SceneGraphBuilder | |
//source: http://pleasingsoftware.blogspot.ca/2012/03/groovyfx-first-official-release.html | |
//run: groovy -classpath $JAVAFX_HOME/rt/lib/jfxrt.jar helloGroovyFX.groovy | |
GroovyFX.start { | |
def sg = new SceneGraphBuilder() | |
sg.stage(title: "GroovyFX Hello World", visible: true) { | |
scene(fill: black, width: 530, height: 300) { | |
hbox(padding: 80) { | |
text(text: "Groovy", style: "-fx-font-size: 80pt") { | |
fill linearGradient(endX: 0, stops: [palegreen, seagreen]) | |
} | |
text(text: "FX", style: "-fx-font-size: 80pt") { | |
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