简体   繁体   English

如何使用Java FX-NetBeans中的源代码

[英]how to use java fx - source code in netbeans

I have downloaded the JavaFx sample source codes and examined "Ensemble" codes. 我已经下载了JavaFx示例源代码并检查了“ Ensemble”代码。 I have some interest on working on those animations, however when I have copied the source code and pasted into Netbeans, I get the following error. 我对处理这些动画有些兴趣,但是当我复制源代码并将其粘贴到Netbeans中时,出现以下错误。 -JavaFX deployment library not found. -找不到JavaFX部署库。

I am not too familiar with Java, so would you please tell me how to integrate the codes into my own project? 我对Java不太熟悉,所以请您告诉我如何将代码集成到我自己的项目中? I think that I could not load the libraries. 我认为我无法加载库。 Thank you. 谢谢。

You don't need to copy and paste the source codes yourself. 您不需要自己复制和粘贴源代码。 In Netbeans click to " Open Project... " and navigate to <javafx_sample_dir>/src directory where the Ensemble will be detected as a Netbeans project. 在Netbeans中,单击“ Open Project ... ”,然后导航到<javafx_sample_dir>/src目录,在该目录中将Ensemble检测为Netbeans项目。 If you are interested in a particular component or feature, just run the Ensemble application and open the related component page and click the " Save NetBeans Project... " button then you can open it in Netbeans. 如果您对特定的组件或功能感兴趣,只需运行Ensemble应用程序并打开相关的组件页面,然后单击“ 保存NetBeans项目... ”按钮,即可在Netbeans中打开它。
If you still facing that error try first to create a new javaFX project and run it in Netbeans. 如果仍然遇到该错误,请首先尝试创建一个新的javaFX项目并在Netbeans中运行它。

Perhaps you have an older version of JavaFX installed and NetBeans is using this as "Default JavaFX Platform" (see NB-Menu Tools|Java Platforms) ? 也许您已经安装了JavaFX的较旧版本,并且NetBeans将其用作“默认JavaFX平台”(请参见NB-Menu Tools | Java Platforms)?

The newest Ensemble is using the Canvas and this is not supported with older JavaFX (<2.2). 最新的Ensemble使用的是Canvas,而较旧的JavaFX(<2.2)不支持此功能。

In this case deinstall all old versions and get the new Java7 with integrated JavaFX Runtime here http://www.oracle.com/technetwork/java/javafx/downloads/index.html 在这种情况下,请卸载所有旧版本,并在此处http://www.oracle.com/technetwork/java/javafx/downloads/index.html上获得带有集成JavaFX Runtime的新Java7

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM