使用Eclipse IDE在浏览器中运行JavaFx应用程序 [英] Run JavaFx Application in browser using Eclipse IDE

查看:1209
本文介绍了使用Eclipse IDE在浏览器中运行JavaFx应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是JavaFx的新手。我发现每个教程都在使用NetBeans IDE for JavaFx。但是我正在使用Eclipse。
我已经在Eclipse中学习和开发了许多独立的javafx应用程序,但现在我想开发在浏览器上运行的JavaFx Application(与applet相同)。我已经搜索,但发现所有的材料与NetBeans IDE只,而不是eclipse。
当我们选择项目属性中的在浏览器中运行选项时,NetBeans会自行生成jnlp,jar和html文件。
如果是Eclipse IDE,该怎么办?
我在eclipse中为Javafx使用e(fx)剪辑插件。
请尽快为此提供一些资料

解决方案

看看,如果您还没有完成所以。



向导工作得很好;虽然有时我发现我需要编辑build.xml和/或生成的jnlp文件,以使事情工作。这很可能是因为我的配置从一开始就不正确。


I am new to JavaFx. I found every tutorials are using NetBeans IDE for JavaFx. But I am using Eclipse. I have learnt and developed many Standalone javafx application in Eclipse but now I want to develop JavaFx Application that runs on browser (same as applet). I have searched but found all material with NetBeans IDE only and not with eclipse. NetBeans generate jnlp, jar and html file by itself as we opt for Run in Browser option in Project Properties. What should I do in case of Eclipse IDE? I am using e(fx)clipse plugin for Javafx in eclipse. Please provide some source for this as soon as possible

解决方案

Have a look at the first tutorial on the e(fx)clipse tutorials page.

To deploy a JavaFX application using e(fx)clipse, the easiest way is to open the "build.fxbuild" file that is created in your project. Enter the required information for the application, then go to the "Deploy" tab (the tabs are at the bottom).

This will bring up a wizard for configuring the applet. The required fields are a width and height for the applet and a "ref" and "id" for the placeholder in the html where the applet will be inserted. (I'm not entirely clear what the "ref" is used for: the "id" is used as an id attribute in the relevant <div>.)

Enter the required values (and others as needed). Return to the "Overview" tab, and click on the "generate ant build.xml and run". This will compile an ant build file and execute it. You will now find a "build" folder in your project with a "deploy" subfolder. In there, you'll find the files required for an applet: the html, jnlp, jar, and a libs folder with any external jars your application requires.

To understand the options in the build wizard, you will need to understand the JavaFX packaging and deployment process. I suggest reading the tutorial, if you haven't already done so.

The wizard works pretty well; though sometimes I find I need to edit the build.xml and/or the generated jnlp file a little to get things to work. This is most likely because my configuration is not correct from the outset.

这篇关于使用Eclipse IDE在浏览器中运行JavaFx应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆