@Grab(group='org.codehaus.groovyfx', module='groovyfx', version='0.4.0') import static groovyx.javafx.GroovyFX.start @Grab(group='io.datafx', module='datasources', version='8.0.7') @Grab(group='org.glassfish', module='javax.json', version='1.0.4') import io.datafx.provider.ListDataProvider import io.datafx.io.RestSource import io.datafx.io.converter.JsonConverter import groovy.transform.ToString @ToString class User { String firstname String lastname } def converter = new JsonConverter("users", User) def source = new RestSource("http://localhost:5050/", converter) def dataProvider = new ListDataProvider(source) start { stage(title: 'DataFXRestSource1', width: 800, height: 500, visible: true) { scene { vbox(spacing: 10, padding: 10) { listView(prefHeight: 400, items: bind(dataProvider.data)) button('Retrieve', onAction: { dataProvider.retrieve() }) } } } }