Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

Application Startup

Edvin Syse edited this page Feb 14, 2016 · 9 revisions

WikiDocumentationApplication Startup

Application Startup

To define the entrypoint for your application, you extend the tornadofx.App class, which in turn extends javafx.application.Application. The only property you need to override is the reference to your primary view:

class HelloWorldApp : App() {
    override val primaryView = MyMainView::class
}

IntelliJ IDEA Users: Make sure you create an Application run configuration, not a Kotlin run configuration.

It is also customary to load stylesheets in the init block of the App class:

init {
    importStylesheet("/style.css")
}

You can further override any JavaFX Lifecycle method if it fits your needs.

Next: Dependency Injection

Clone this wiki locally