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

**URL:** <https://discourse.processing.org/t/solved-i-get-a-nullpointerexception-when-switching-from-the-default-rendering-technique-to-javafx-2d/42601>\
**Category:** Libraries\
**Created:** [August 16, 2023, 8:06pm UTC](https://discourse.processing.org/t/solved-i-get-a-nullpointerexception-when-switching-from-the-default-rendering-technique-to-javafx-2d/42601 "2023-08-16T20:06:32Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [August 16, 2023, 8:13pm UTC](https://discourse.processing.org/t/solved-i-get-a-nullpointerexception-when-switching-from-the-default-rendering-technique-to-javafx-2d/42601/2 "2023-08-16T20:13:58Z")

</div>

Hello @MrImskiy,

You must add the JavaFX library with Processing 4.3:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/e/6/e6a39fe4078216a95777916a6f767bcedc4e3bb4.png)

Test with String.hashCode():

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/b/0/b07633be3ac29c220bdcc9fedd4222f92a3d0d1d.png)

Important topic related to JavaFX:

> [@JavaFX Unable to add modules to Processing IDE](https://discourse.processing.org/t/javafx-unable-to-add-modules-to-processing-ide/41272):
>
> The following JavaFX code will not run in Processing 4 due to absence of JavaFX modules (runs ok in version 3.5.4 minus the first line). I have tried many times adding the modules to the libraries folder or drag 'n dropping them on the sketch, but neither have worked. Text and graphics work fine with the FX2D renderer, but the controls won’t work. It is possible to create graphic buttons and trap mouse clicks or use SwingNode and add Swing components, but it just seems like we should be able …

`:)`

---

_[View the full topic](https://discourse.processing.org/t/solved-i-get-a-nullpointerexception-when-switching-from-the-default-rendering-technique-to-javafx-2d/42601)._
