- Let's first create a class with empty methods, which would represent the main application for launching the application as well as the JavaFX UI:
public class BrowserDemo extends Application{ public static void main(String[] args) { Application.launch(args); } @Override public void start(Stage stage) { //this will have all the JavaFX related code } }
In the subsequent steps, we will write all our code within the start(Stage stage) method.
- Let's create a javafx.scene.web.WebView component, which will render our web page. This has the required javafx.scene.web.WebEngine instance, which manages the loading of the web page:
WebView webView = new WebView();
- Get the instance of javafx.scene.web.WebEngine used by webView ...