Java Reference
In-Depth Information
import javafx.util.Duration;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
/**
* Recipe 17-3: Manipulating HTML5 Content
* @author cdea
* Updated: J Juneau
*/
public class ManipulatingHtmlContent extends Application {
String url = "http://weather.yahooapis.com/
forecastrss?p=USMD0033&u=f";
int refreshCountdown = 60;
@Override public void start(Stage stage) {
// create the scene
stage.setTitle("Chapter 17-3 Manipulating HTML5
content");
Group root = new Group();
Scene scene = new Scene(root, 460, 340);
final WebEngine webEngine = new WebEngine(url);
StringBuilder template = new StringBuilder();
template.append("<head>\n")
.append("<style type=\"text/css\">body
{background-color:#b4c8ee;}</style>\n")
.append("</head>\n")
.append("<body id='weather_background'>");
final String fullHtml = template.toString();
final WebView webView = new WebView();
IntegerProperty countDown = new
SimpleIntegerProperty(refreshCountdown);
countDown.addListener((ObservableValue<? extends
Number> observable, Number oldValue,
Number newValue) -> {
Search WWH ::




Custom Search