Java Reference
In-Depth Information
Inkscape. Another impressive and beautiful display of custom controls that focuses on
gauges and dials is the Steel Series by Gerrit Grunwald. To be totally amazed, visit his
blog at http://harmoniccode.blogspot.com .
17-3.
Manipulating
HTML5
Content
with Java Code
Problem
You want to generate HTML5 content via Java code and display it in your JavaFX ap-
plication.
Solution
Implement a solution that formulates HTML5 content in string format. Once you've
created the desired HTML5 content, you'll display it using a WebView node. This ex-
ample creates a weather application that fetches data from Yahoo!'s weather service.
The following code implements a weather application that retrieves Yahoo!'s weather
information to be rendered as HTML in a JavaFX application:
package org.java8recipes.chapter17.recipe17_03;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.application.Application;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Worker.State;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
Search WWH ::




Custom Search