Define LookAndFeel in Kotlin


#1

Hi All

I am trying to workout how I can change the LookAndFeel when using Kotlin, JavaFX and Tornado

To me the most logic place to put the code is in the main class init{} section. I tried it just about everywhere else but it made no difference. This code works perfectly well in Java, and when I run the application I do not get any errors.

init {
    println("Starting application")
    try {
        UIManager.setLookAndFeel("com.jtattoo.plaf.noire.NoireLookAndFeel")
    } catch(e: Exception){
        e.printStackTrace()
    }
}

Can someone point me in the right direction?


#2

Ignore this, I was trying to apply a theme to a scene not a frame!
Got it working now!