O'Reilly logo

JavaFX Essentials by Mohamed Taman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

JavaFX on the Web

In this section, we will learn about JavaFX on the Web and how to deploy our note-taking application there.

WebEngine

JavaFX provides a non-GUI component capable of loading HTML5 content, called the WebEngine API (javafx.scene.web.WebEngine). This API is basically an object instance of the WebEngine class to be used to load a file containing HTML5 content. The HTML5 file could be loaded from a local file system, a web server, or from inside a JAR file.

When a file is loaded using a web engine object, a background thread is used to load the file content to not block the JavaFX application thread.

The following are two WebEngine methods for loading HTML5 content:

  • load(String URL)
  • loadContent(String HTML)

WebView

JavaFX provides a GUI ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required