Last active
February 7, 2018 13:20
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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