问题
I tried to start developing an NB platform application that holds a JFXPanel
in a TopComponent
. Unfortunately, an Exception is thrown at runtime when the JFXPanel
is instantiated. I saw that it's because i don't have the JavaFX native libs (like glass.dll) in the sub-directories of my project.
Before i try to solve the problem just by copying the files, I'd like to ask you if there is a better way. In my opinion, i shouldn't have to copy the native libs into my project because they should be delivered by the system my app is installed to.
回答1:
How did you added JavaFX dependency to your Java project? Usual way is to add jfxrt.jar to dependencies, and in this case native libs will be caught automatically.
Another reason may be the wrong behavior of the lib copy option of Netbeans. Right click on project, then go to
Properties -> Build -> Packaging
and uncheckCopy Dependent Libraries
option.Also you can try to download JavaFX Samples, open "Swing Interoperability App" and see how that project works.
来源:https://stackoverflow.com/questions/10474072/using-javafx-in-a-netbeans-platform-application