How to do it...

  1. Create a class that extends javafx.application.Application. The Application class manages the life cycle of the JavaFX application. The Application class has an abstract method, start(Stage stage), which you have to implement. This would be the starting point for the JavaFX UI:
        public class CreateGuiDemo extends Application{
          public void start(Stage stage){
            //to implement in new steps
          }
        }

The class can also be the starting point for the application by providing a public static void main(String [] args) {} method:

        public class CreateGuiDemo extends Application{
          public void start(Stage stage){
            //to implement in new steps
          }
          public static void main(String[] args){
            //launch the JavaFX application
          }
        }

The code for the subsequent ...

Get Java 11 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.