Does JavaFX's AnimationTimer
run on a separate thread when launched?
I ran a JavaFX application in a debugger, with and without a AnimationTimer
, and in both cases there were 6 threads running. Plus, the JavaDocs don't mention it implementing Runnable
.
That suggests that it's not run in its own thread, but by its very nature, I'd think it would need to run in its own thread to ensure it runs in a regular enough schedule.
And if it's not run in its own thread, is it just run in whatever thread creates it? Does that mean it's safe to modify UI elements from within the Timer if I create the AnimationTimer
inside of Application
's start()
?