Creating a runnable application

From src/main/kotlin, open App.kt. Replace its content with the following:

    package javafxdemo    fun main(args: Array<String>) {    }

Place the cursor after the package statement and add a new blank line. Type the following:

    class KotlinJavaFXDemo :

Type Appl and press Ctrl + Space bar (cmd + Space bar on Apple machines); the Eclipse IDE will show a popup window with suggestions:

Find the Application class from the javafx.application package in the list and double-click it or press Enter. An import statement will be added and the Application class name will be written for you. Now add () , so that our subclass ...

Get Introduction to JVM Languages 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.