Using JavaFX in a Netbeans Platform application

人盡茶涼 提交于 2019-12-13 03:56:03

问题


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:


  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.

  2. 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 uncheck Copy Dependent Libraries option.

  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!