7

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

1 Answer 1

7

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>.)

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

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.

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you...Its working but now I am getting some security issue but I think that may be Firewall settings..But I have now jnlp jar and html files
Yes, there will likely be a whole new set of issues for you to deal with now you have it creating the applet :). Note that there's a "Signing" tab on the wizard; you will likely need to digitally sign it for any browser to let it run.
Hie I have follow the way you have told me but now the problem is that it generate jnlp jar and html files but when I run the Html file in browser It only shows the rectangle box that of my height and width but no JavaFx contents display on the browser. Please guide me on this.I run the jar file and it works perfectly well
Please post new questions when you have them; don't ask new questions in the comments on old ones. Be sure to search thoroughly for existing questions first.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.