2016-02-02 172 views
0

我很烦恼这里加载一个网站到webviewer的一些问题。JavaFX的webview显示某些网站上的空白页面

我跟着代码 here,改变其朝向

import javafx.application.Application; 
import javafx.scene.Scene; 
import javafx.scene.layout.Region; 
import javafx.scene.paint.Color; 
import javafx.scene.web.WebEngine; 
import javafx.scene.web.WebView; 
import javafx.stage.Stage; 

public class WebViewSample extends Application { 
    private Scene scene; 
    @Override public void start(Stage stage) { 
      // create the scene 
     scene = new Scene(new Browser(),900,600, Color.web("#666970")); 
     stage.setScene(scene); 
     stage.show(); 
    } 

    public static void main(String[] args){ 
     launch(args); 
    } 
} 
class Browser extends Region { 

    final WebView browser = new WebView(); 
    final WebEngine webEngine = browser.getEngine(); 

    public Browser() { 

     webEngine.setJavaScriptEnabled(true); 
      // load the web page 
     webEngine.load("https://www.immomapping.com/"); 
      // add the web view to the scene 
     getChildren().add(browser); 
    } 
} 

它表明我只是一个空白页。我试图检查here代理,但没有去任何地方。

有人可以帮我吗? website是德语,但应该没关系。

还是有人知道如何操作网站(在浏览器中打开,例如Internet Explorer:X),就像它能够用VBA一样?

在此先感谢!

回答