Skip to content

Instantly share code, notes, and snippets.

@gildor
Created June 5, 2018 03:45
Show Gist options
  • Save gildor/0e33c8d8a3bf647c41d9a12fdefb8169 to your computer and use it in GitHub Desktop.
Save gildor/0e33c8d8a3bf647c41d9a12fdefb8169 to your computer and use it in GitHub Desktop.
Minimal TornadoFX setup with Gradle
//File build.gradle
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.41"
id "application"
}
mainClassName = "HelloWorldKt"
repositories {
jcenter()
}
compileKotlin {
kotlinOptions.jvmTarget= "1.8"
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
compile 'no.tornado:tornadofx:1.7.16'
}
//File src/main/kotlin/HelloWorld.kt
import tornadofx.*
class HelloWorld : View() {
override val root = hbox {
label("Hello world")
}
}
class MyApp : App(HelloWorld::class)
fun main(args: Array<String>) {
launch<MyApp>(args)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment