0

I use java.util.Timer to run a method every 10th of a second.

I have to cancel this before exiting ScalaFX.

How do I accomplish this?

jwpfox
  • 5,124
  • 11
  • 45
  • 42
J. Busk
  • 17
  • 4

1 Answers1

0

JFXApp has method stopApp that is called when the application stops. You can cancel your timer there.

Jarek
  • 1,513
  • 9
  • 16
  • It works! Overriding the JFXApp stopApp() was the answer. override def stopApp() { tempTimer.cancel() stage.close() } – J. Busk Sep 09 '16 at 18:18