Launch a JavaFx application in a browser using the Eclipse IDE

I am new to JavaFx. I found that every tutorial uses the NetBeans IDE for JavaFx. But I use Eclipse. I have studied and developed many Standalone javafx applications in Eclipse, but now I want to develop a JavaFx application that works in the browser (same as the applet). I searched, but found all the materials, only with the NetBeans IDE, and not with eclipse. NetBeans creates the jnlp, jar, and html file on its own, as we select the Run in Browser option in Project Properties. What to do in case of Eclipse IDE? I am using the e (fx) clipse plugin for Javafx in eclipse. Please provide several sources for this as soon as possible.

+7
eclipse jnlp javafx-2
source share
1 answer

Take a look at the first tutorial on the e (fx) page of clip lessons .

To deploy a JavaFX application using the e (fx) clip, the easiest way is to open the build.fxbuild file created in your project. Enter the necessary information for the application, then go to the "Deploy" tab (tabs below).

The applet configuration wizard appears. Mandatory fields are the width and height for the applet and the "ref" and "id" for the placeholder in the html where the applet will be inserted. (I do not quite understand what "ref" is used for: "id" is used as the id attribute in the corresponding <div> .)

Screenshot of "Deploy" tab in e (fx) clipse build.fxbuild wizard

Enter the required values ​​(and others, if necessary). Go back to the "Overview" tab and click "generate ant build.xml and run." This will compile the ant build file and execute it. Now you will find the "build" folder in your project with the "deploy" subfolder. There you will find the files necessary for the applet: html, jnlp, jar and the libs folder with any external banks that your application requires.

To understand the parameters in the build wizard, you will need to understand the process of packaging and deploying JavaFX. I suggest you read the tutorial if you haven’t already.

The wizard works very well; although sometimes it seems to me that I need to edit the build.xml file and / or the generated jnlp file a bit to make the work work. This is most likely due to the fact that my configuration is incorrect from the very beginning.

+7
source share

All Articles