Skip to content

Instantly share code, notes, and snippets.

@ValeriusGC
Last active February 7, 2018 13:20
Show Gist options
  • Save ValeriusGC/9ee5d5b00ee9ba5f4fe7ca26761d0eeb to your computer and use it in GitHub Desktop.
Save ValeriusGC/9ee5d5b00ee9ba5f4fe7ca26761d0eeb to your computer and use it in GitHub Desktop.
Here is the trouble with runAsync: When application closing it stay in memory yet, as red square button 'stop' on the panel active yet.
package com.gdetotut
import javafx.application.Application
import javafx.scene.control.Button
import javafx.scene.control.Label
import javafx.scene.layout.VBox
import tornadofx.*
import java.lang.Thread.sleep
class MyApp: App(MyView::class)
class MyView: View() {
override val root = vbox {
button("press me...") {
action {
runAsyncWithProgress {
sleep(1000)
} ui {
text = "yes!!!"
}
}
}
label("waiting") {
}
}
}
fun main(args: Array<String>) {
Application.launch(MyApp::class.java, *args)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment