Skip to content

Instantly share code, notes, and snippets.

@ivanarrizabalaga
Last active December 31, 2015 20:48
Show Gist options
  • Save ivanarrizabalaga/8042145 to your computer and use it in GitHub Desktop.
Save ivanarrizabalaga/8042145 to your computer and use it in GitHub Desktop.
After checking the source code of groovyx.javafx.SceneGraphBuilder. Mixing a griffon view + swing toolkit + javafx, the way I expected it to be=>ERROR
package testmixfx
import javafx.embed.swing.JFXPanel
import groovyx.javafx.GroovyFX
import javafx.application.Platform;
import javafx.embed.swing.JFXPanel;
import javafx.scene.Scene;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import groovyx.javafx.SceneGraphBuilder;
JFXPanel jfxPanel = new JFXPanel();
def DEFAULT_URL = "http://www.yahoo.com"
application(title: 'testmixfx',
preferredSize: [320, 240],
pack: true,
locationByPlatform: true,
iconImage: imageIcon('/griffon-icon-48x48.png').image,
iconImages: [imageIcon('/griffon-icon-48x48.png').image,
imageIcon('/griffon-icon-32x32.png').image,
imageIcon('/griffon-icon-16x16.png').image]) {
// add content here
panel(id:"myPanel",preferredSize: new Dimension(800,400)){
migLayout(layoutConstraints: 'fill')
label('Content Goes Here',constraints:"wrap")
widget(jfxPanel)
}
//http://svn.codehaus.org/gmod/groovyfx/trunk/groovyfx/src/demo/groovy/SwingDemo.groovy
//http://fxexperience.com/2011/07/interview-with-the-developers-behind-groovyfx/
GroovyFX.start {
def sg = new groovyx.javafx.SceneGraphBuilder(true);
jfxPanel.scene = sg.scene(width: 800, height: 400) {
webEngine = webEngine(location: DEFAULT_URL)
webView(engine: webEngine)
}
} //-->ERROR: No signature of method: java.lang.Object.webEngine() is applicable for argument types: (java.util.LinkedHashMap, null) values: [[location:http://www.yahoo.com], null]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment