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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.