JavaFX is more for user interface development with some graphic API. It contains a lot of components for use by the user. It is also
Java based which means it's usable on platforms with compatible Java virtual machines (JVM).
DirectX and OpenGL are graphical APIs which focus more on the lower level graphic and rendering side of things. Additionally the are more platform specific with native platform specific API. Although OpenGL is available on many platforms and DirectX may have some .NET/Mono/C# type binding that prove a degree of cross platform support.