Skip to main content

JavaFX in the browser?

5 replies [Last post]
mephtu
Offline
Joined: 2007-12-31
Points: 0

I saw the JavaFX applet thing but I'm still thinking "this is weird." What a strange way to deploy a JavaFX app! I would like to see a browser plugin or extension which would detect JavaFX files and display them the way the flash plugin works. Are there any plans for this (obvious?!) oversight?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jim_weaver
Offline
Joined: 2007-05-18
Points: 0

In compiled JavaFX Script (which is the direction that JavaFX Script is going), there will soon be a way to create a JavaFX Script applet using declarative syntax. According to Chris Oliver, there is no good way to do applets in interpreted JavaFX Script. I have been encouraging developers to begin playing around with compiled JavaFX Script. The JavaFX Script Compiler project site is https://openjfx-compiler.dev.java.net/ and there is a Compiled JavaFX Script category in my LearnJavaFX weblog http://learnjavafx.typepad.com that has some information to help you get started. When applet support is available, I'll do a post on how to use it.

Thanks,
Jim Weaver

pupmonster
Offline
Joined: 2003-07-02
Points: 0

Jim,

I'm still confused about the place of JavaFX in the browser.

Does one for example embed some sort of tag in a webpage that launches a JavaFX application, and does the application then run outside of the browser, or does JavaFX run within a browser like JavaScript?

Any clarification would be much appreciated.

Steve

whp
Offline
Joined: 2006-06-09
Points: 0

Now it is only possible to run JavaFX Script application in the interpreted mode and thus you can only run outside of browser. In the near (hopefully) future it will be possible to create applets using JavaFX Script. Applets run inside the browser.

JavaFX Script doesn't run within a browser like a Javascript and won't run. Javascript is interpreted inside the browser, JavaFX Script is interpreted outside, and applets are not interpreted they are handled by the Java browser plugin.

pupmonster
Offline
Joined: 2003-07-02
Points: 0

Thanks, Jim.

If I may, I wonder if you can provide just a bit more clarification for the future. I'll ask by way of example.

Recently, for our company, we created an Google Web Toolkit app which allowed our customers to enter the shipments that were coming our way. We secured it the traditional way. This GWT in-the-browser app hit a server running a servlet which in turn hit our internal services.

Will JavaFX script be a viable platform for things like this, or will it have the "scary" applet warnings and so on, the need for them notwithstanding.

I liked the GWT, as it allowed us to write in Java, but it would appear that JavaFX would be even more powerful, as it would ultimately not be JavaScript running in the browser, but Java via the plug-in. Am I getting this more or less right?

Thanks,

Steve

jim_weaver
Offline
Joined: 2007-05-18
Points: 0

Steve,

Your reply was to someone else's response. Regarding compiled JavaFX Script running in the browser, it would run as an applet, being invoked by an HTML file. Optimally it would have the benefit of the browser plug-in and other performance improvements available with Java SE 6 update 10.

Regarding security warnings, as long as the JavaFX Script applet behaves (e.g. doesn't try to do file I/O or contact a different host that from where it was obtained), the warning messages shouldn't appear. Otherwise, the java.policy file has to be modified to avoid the warnings.

This "compiled JavaFX Script in the browser" capability is almost ready. I saw another check-in of the javafx.ui.Applet class this evening, so I know that the JavaFX Script compiler team is getting close. The compiled JavaFX Script applet would communicate with the server in a like manner to your GWT example. See the http://javafxpert.com/weblog/2008/01/xml-and-json-pr.html weblog post for pieces that are being added to JavaFX Script that will make server communication with the client very simple.

Thanks,
Jim Weaver
"Making You a JavaFXpert" weblog: http://javafxpert.com

Thanks,
Jim Weaver
"Making You a JavaFXpert" weblog: http://javafxpert.com