How to stop JavaFX clients in SBT

As a brief note, you need this setting in your build.sbt file if you want JavaFX client/GUI applications to properly stop in SBT:

// see:
fork in run := true

Conversely, if you don’t use that setting and then you stop your JavaFX app that you started inside SBT, the app won’t stop properly and it will leave a Java process running, and at that point about all you can do is kill SBT and restart it, which gets annoying after a very short while. That setting causes SBT to create and run the JavaFX app in a new JVM. As noted in the code, I found that setting on SO.