[SOLVED] I get a NullPointerException when switching from the default rendering technique to JavaFX 2D

I have tried P2D, which made the rendering faster, but not as fast as needed. That’s why I wanted to test FX2D.