2016-04-13 13 views
0

Webview is not displaying correctlyWebView Sol tarafa <strong>Google Chrome</strong> ve sağ tarafta yüklü <strong>html sayfası</strong> olduğunu <strong>JavaFX WebView'da</strong> yüklenen <strong>html sayfası</strong> olduğu doğru

görüntülüyor değil, sorun olmasıdır Google Map için navagasyon paneli, JavaFx WebView'da görüntülenmez. Java 7u79'u kullanıyorum.

GoogleMap.java

webView = new WebView(); 
webEngine = webView.getEngine(); 
webEngine.getLoadWorker().stateProperty().addListener(new ChangeListener<State>(){ 
    @Override 
    public void changed(ObservableValue<? extends State> ov, State t, State t1) { 
     System.out.println("STATE : " + t1); 
     if(t1.equals(State.SUCCEEDED)){ 
      root.getChildren().remove(indicator); 
     } 
    } 
}); 

indicator = new ProgressIndicator(); 
indicator.setMaxSize(40, 40); 

String htmlcode = getFileContent("GoogleMap.html"); 
webEngine.loadContent(htmlcode); 

root = new StackPane(); 
root.setAlignment(Pos.CENTER); 
root.getChildren().add(webView); 
root.getChildren().add(indicator); 


Scene scene = new Scene(root, 550, 400); 

primaryStage.setTitle("Google Map"); 
primaryStage.setScene(scene); 
primaryStage.show(); 

GoogleMap.html

<!DOCTYPE html> 
<html> 
<head> 
<script src="http://maps.googleapis.com/maps/api/js"></script> 
<script> 
function initialize() { 
    var mapProp = { 
    center : new google.maps.LatLng(51.508742,-0.120850), 
    zoom : 5, 
    mapTypeId : google.maps.MapTypeId.ROADMAP 
    }; 
    var map=new google.maps.Map(document.getElementById("googleMap"),mapProp); 
} 
google.maps.event.addDomListener(window, 'load', initialize); 
</script> 
<style> 
    body 
    { 
     padding : 0; 
     margin : 0; 
    } 
    #googleMap 
    { 
     width : 550px; 
     height : 400px; 
    } 
</style> 
</head> 

<body> 
<div id="googleMap"></div> 
</body> 

</html> 

cevap

0

onunla tüm ok var. enter image description here

java 1.8.0_73 belki de java'yı güncellemeyi veya yeni JavaFX almayı denemelisiniz?

İlgili konular