JavaFX Script and Java

拟墨画扇 提交于 2019-12-10 09:50:37

问题


Simple question: Can I mix in my desktop application Java and JavaFX Script code? If it is possible could you provide me with some link with examples? Or could I pack my custom made javafx CustomNode-s in a jar and use them in my project side by side with standard SWING components?


回答1:


This article gives an example of calling JavaFX from Java, using the Scripting API.




回答2:


Yes, you can mix Java and JavaFX.

According to one of the FAQ entries:

In addition, developers can use any Java library in their JavaFX applications. This allows JavaFX applications to take advantage of the rich JavaFX UI libraries, as well as the amazing breadth of functionality offered by Java.

The official source of information, including tools downloads, FAQ, and tutorials is the JavaFX web site.




回答3:


I suggest you to look at dotFX. It can be useful for you. It has a netbeans plugin,too.

Read first here for get more information.




回答4:


You can use a JavaFX 2.0 with Swing http://javafx.com/about-javafx/

If you install the JavaFX 2.0 runtime first, then you launch an example http://download.oracle.com/otndocs/products/javafx/samples/SwingInterop/index.html




回答5:


Supposedly all you have to do is drag and drop the JavaFX application to your desktop in order to make it a desktop application. You can also use Java code in a JavaFX application. Not sure about the other way around.




回答6:


Yes Javafx and java apis can be mixed and used in your application without any problems.



来源:https://stackoverflow.com/questions/359683/javafx-script-and-java

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