I could not find any example, neither any resource on how to create a splash screen in tornadofx. I have a working splash screen in plain javafx along the same line of this example : https://gist.github.com/jewelsea/2305098
But, I have no clue on how to achieve it in tornadofx as it uses different paradigm with views and fragments instead of stage and screen.
You are not using the JavaFX preloader here as far as I can see, so this is really no different from opening one View while you do your loading, and then replacing that View with another View when you're done. Just point your app class to a
SplashScreenView
, handle your loading there, then doreplaceWith(MainView::class)
when you are done. InMainView
, you might want to override theonDock
callback and docurrentStage?.sizeToScene()
to make sure the window resizes to your desired size.