Here is my code
Everything i tried gives an nullPointerException.
I commend you for working with JavaFX- it's pretty nifty, and offers a lot of advantageous over AWT/swing. I do have to say though mate, you posted a lot of code. JavaFX with the FXML allows for dynamic run-time loading, so you don't have to use as much code-behind. This is convenient, but there's several places where a variable could be uninitialized. Have you tried running this in debug? Where does the program get to right before it gets a NullPointer? A little more detail of the line the exception is occurring on, or the calling function would be very helpful here.
and now i get a null pointer exception in the clearPane method in mainWindowController.
Here is the whole stacktrace of the nullPointer
My plan is to use the same code for a bunch of other things in my app. If you think that i should try a different way and somehow restructure my app please let me know, i would really appreciate any suggestion.
Filip Kekev wrote:When the user opens the window the sort box is empty, and then he selects something which should run the code from the mainWindowController. I know that the problem is with the way I'm getting the instance of the controller so I made some changes and now the changablePane is not created by the fxml file, I'm creating it by java code and made it static. That way I can make the clearPane() mehod static and call it from another class without creating an instance of the MainWindowCotroller. Now the problem is that the app doesnt show the changablePane with the filtered notes after it clears it.
Can you post your code?