将Java FX 2.0添加到现有的Netbeans项目中

将Java FX 2.0添加到现有的Netbeans项目中

问题描述:

我在Netbeans中有一个使用Swing的现有Java项目,我想开始在该项目的某些组件中使用Java FX 2.0。
我已经下载了最新版本的JDK(1.7.0_03)并启用了JavaFX但是当我尝试添加 import javafx.xxx 语句时,Netbeans不能解决链接。我是否需要手动将一些JAR添加到我的外部库列表中?

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?

项目属性使用JDK 1.7-FX Enabled:

Project Properties use "JDK 1.7-FX Enabled":

以这种方式配置:

如果您在较旧的NetBeans中创建项目,它可能会错过来自FX启用的plaftorm的库。

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

您可以:


  • 在NetBeans 7.1+中重新创建项目并复制来源

  • 或包含libs的下一个库: C:/ Program Files / Oracle / JavaFX 2.0 SDK / rt / lib / jfxrt.jar

  • 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