0
How do I use the webview
when I use:
public void site(){
WebView browser = new WebView();
WebEngine webEngine = browser.getEngine();
webEngine.load("http://mySite.com");
}
I have the error:
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at javafx.scene.web.WebEngine.<clinit>(WebEngine.java:315)
at javafx.scene.web.WebView.<init>(WebView.java:273)
I need to use inside a void
for she will be called in a actionlistener
from a button further forward.
According to the documentation:
WebView objects must be created and accessed solely from the FX thread
.– Renan Gomes