Wednesday, 14 August 2013

Java WebView cannot load some of the websites

Java WebView cannot load some of the websites

I am using Webengine to load the website, it is success for loading google
& yahoo
but when i used to load "http://www.baidu.org" ,it is not working, but i
can use firefox to load successful.
Here is my loading code
private void createScene() {
PlatformImpl.startup(new Runnable() {
@Override
public void run() {
stage = new Stage();
stage.setResizable(true);
Group root = new Group();
Scene scene = new Scene(root);
stage.setScene(scene);
browser = new WebView();
webEngine = browser.getEngine();
webEngine.load("http://www.baidu.org"););
ObservableList<Node> children = root.getChildren();
children.add(browser);
jfxPanel.setScene(scene);
}
});
}
I am a rookie in Java, can someone give me a hand on it?

No comments:

Post a Comment