Java Reference
In-Depth Information
webView.getEngine().executeScript("document.getElementById('countdown').innerHTML
= 'Seconds till
refresh: " + newValue + "'");
if (newValue.intValue() == 0) {
webEngine.reload();
}
});
final Timeline timeToRefresh = new Timeline();
timeToRefresh.getKeyFrames().addAll(
new KeyFrame(Duration.ZERO, new
KeyValue(countDown, refreshCountdown)),
new
KeyFrame(Duration.seconds(refreshCountdown), new
KeyValue(countDown, 0))
);
webEngine.getLoadWorker().stateProperty().addListener((ObservableValue<?
extends State>
observable, State oldValue, State newValue) -> {
System.out.println("done!"
+ newValue.toString());
if (newValue != State.SUCCEEDED) {
return;
}
// request 200 OK
Weather weather
= parse(webEngine.getDocument());
StringBuilder locationText = new
StringBuilder();
locationText.append("<b>")
.append(weather.city)
.append(", ")
.append(weather.region)
.append(" ")
.append(weather.country)
.append("</b><br />\n");
Search WWH ::




Custom Search