Views

The primary View is the default View that is set when the application is opened. It is set in the App class, which does the job of loading this View when the app opens.

Every View needs to override the root property, which contains the layout for the View. The root property contains a hierarchy of JavaFX nodes (which are kind of View methods).

The following is an example of a View with an empty layout:

    class MainView : View("Dictionary") {          override val root = vbox {        // Contains the View hierarchy      }    }

It will show an empty window with the title of Dictionary

Get Kotlin Blueprints 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.