Add Java FX 2.0 to existing Netbeans project

2019-02-21 14:19发布

I have an existing Java project in Netbeans that uses Swing and I would like to start using Java FX 2.0 for some components in that project. I have dowloaded the latest version of the JDK (1.7.0_03) and enabled JavaFX but when I try adding an import javafx.xxx statement, Netbeans can't resolve the link. Do I need to manually add some JARs to my list of external libraries?

Project Properties use "JDK 1.7-FX Enabled":

enter image description here

which is configured this way:

enter image description here

1条回答
forever°为你锁心
2楼-- · 2019-02-21 15:03

If you created your project in older NetBeans it can miss libraries from FX enabled plaftorm.

You can:

  • either recreate the project in NetBeans 7.1+ and copy sources
  • or include next library to the libs: C:/Program Files/Oracle/JavaFX 2.0 SDK/rt/lib/jfxrt.jar
查看更多
登录 后发表回答