Open novakmi opened 7 years ago
You may just use the closure parameter of type groovyx.javafx.GroovyFX
Sample groovy class:
import static groovyx.javafx.GroovyFX.start
start { app ->
stage(title: 'GroovyFX web site', width: 500, height: 200, show: true) {
scene(fill: groovyblue) {
stackPane {
button('GroovyFX web site', onAction: {
def js = app.hostServices.showDocument('http://groovyfx.org/')
})
}
}
}
}
Thanks, it works :-) I was not aware app
can be added to start
closure.
Sometimes it is necessary to have access to the instance of
Application
. For example to callgetHostServices()
orgetParameters()
. Is there any way to do it? Seems like GroovyFX hides this instance completely.