JavaFX is/was part of the Oracle JDK, but is no longer bundled in Java 11 JDK, and OpenJDK always had it separately bundled. But the openjdk implementation OpenJFX it is now available via maven repositories (not sure if these work with Java 8).
As you want to use them from Scala, you may be interested in ScalaFX, which is a wrapper around JavaFX that allows more idiomatic Scala code. It works with JavaFX 8 and 11. Their Github Page includes the sbt snippets you need. If you don’t want to use ScalaFX, try the snippet for Java 11 without the scalafx dependency line.
As you say you want to create a Tetris game, maybe a game engine is more suitable. You actually can use any Java Library from Scala, so there is more choice than just JavaFX. I don’t have any experience in that area, but know of the existence of at least three game engines for Java, libGDX, LitEngine and JMonkeyEngine. If you want to do more game development, they may be worth a look.
Certainly, just add a dependency in the build.sbt file. The scalafx.org site should give the proper format. I often just search “scalafx maven” and look at the sbt formatting they list there. That works with lots of dependencies that are published to the Maven repositories.
They have branches of ScalaFX that support Java 10 and Java 11. I personally am still using Java 8, so I can’t say anything about the stability or usability of other versions of Java for this purpose.
An additional option to consider: you could write it in Scala.js instead, which compiles the Scala code to JavaScript, and then run it in your web browser – that lets you use any of the zillion browser UI frameworks out there. That’s how I would do this personally…
[dirk@desktop scalafx-hello-world]$ sbt run
[info] Loading settings for project scalafx-hello-world-build from plugin.sbt ...
[info] Loading project definition from /home/dirk/dev/scala/scalafx-hello-world/project
[info] Updating ProjectRef(uri("file:/home/dirk/dev/scala/scalafx-hello-world/project/"), "scalafx-hello-world-build")...
[info] Done updating.
[info] Loading settings for project scalafx-hello-world from build.sbt ...
[info] Set current project to ScalaFX Hello World (in build file:/home/dirk/dev/scala/scalafx-hello-world/)
[info] Updating ...
[info] Done updating.
[info] Compiling 1 Scala source to /home/dirk/dev/scala/scalafx-hello-world/target/scala-2.12/classes ...
[info] Done compiling.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/home/dirk/.sbt/boot/scala-2.12.7/org.scala-sbt/sbt/1.2.4/protobuf-java-3.3.1.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[info] Packaging /home/dirk/dev/scala/scalafx-hello-world/target/scala-2.12/scalafx-hello-world_2.12-11-R16.jar ...
[info] Done packaging.
[info] Running (fork) hello.ScalaFXHelloWorld
[error] (java:3390): Gdk-CRITICAL **: 14:26:12.325: gdk_x11_display_set_window_scale: assertion 'GDK_IS_X11_DISPLAY (display)' failed
[info] #
[info] # A fatal error has been detected by the Java Runtime Environment:
[info] #
[info] # SIGSEGV (0xb) at pc=0x00007faf040c442b, pid=3390, tid=3423
[info] #
[info] # JRE version: OpenJDK Runtime Environment (11.0.1+13) (build 11.0.1+13)
[info] # Java VM: OpenJDK 64-Bit Server VM (11.0.1+13, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
[info] # Problematic frame:
[info] # C [libX11.so.6+0x3142b]
[info] #
[info] # Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e" (or dumping to /home/dirk/dev/scala/scalafx-hello-world/core.3390)
[info] #
[info] # An error report file with more information is saved as:
[info] # /home/dirk/dev/scala/scalafx-hello-world/hs_err_pid3390.log
[info] #
[info] # If you would like to submit a bug report, please visit:
[info] # http://bugreport.java.com/bugreport/crash.jsp
[info] # The crash happened outside the Java Virtual Machine in native code.
[info] # See problematic frame for where to report the bug.
[info] #
[error] Nonzero exit code returned from runner: 134
[error] (Compile / run) Nonzero exit code returned from runner: 134
[error] Total time: 4 s, completed 26.12.2018, 14:26:12