Closed albertoclarit closed 7 years ago
You cannot use a main method with FXLauncher, you must simply point it to your application class that extends javafx.application.Application
and it will do the rest, including passing any parameters if the app was started with any.
The NPE is not coming from your app class, but from the Launcher
class of FXLauncher. It is telling of that the app
instance couldn't be created, most likely because the class you pointed it to is either missing or it's missing a default constructor.
As the error message hints to, there is more information in the log file. I suspect you will find an error starting with "Error creating app class" there.
If this doesn't help you to resolve the issue, please post a minimal example showing the error.
I finally understand it ... thanks... this issue is now closed
Great! Can you share what the problem was? :)
I did not completely understand fxlauncher...
Im using your tornadofx framework and uses the main method in the guide. I thought fxlauncher supports tornadofx directly...
That's exactly what it does - it supports JavaFX and TornadoFX directly so it doesn't need a main method :)
Oh yes.. I mean the package level main function...
I was try to initialize a IconFontFX and i thought i could put it in the main method.
But now I was able to do it like this
I have an NPE
When I use the main method (take note of the redundant null checking on args to make sure)
My Gradle config
When Im not using the main method... it works fine.