How to make a debounce click with tornadofx, does ...
# tornadofx
m
How to make a debounce click with tornadofx, does anyone know?
r
Use a
PauseTransition
and
playFromStart
on each click. Put the actual click action in
onFinished
.
m
Thank you, any example example there?
Copy code
I need to solve a problem with many clicks on the same button
r
I'm not at a computer, so forgive any errors (I'm doing this from memory)
Copy code
val debounce = PauseTransition(time)
debounce.setOnFinished {
    // do clicky things
}
button.action {
    debounce.playFromStart()
}
🙂 1
m
Thanks
👍 1