I had a nice long talk today with the guys from Sandec (sandec.de). They were showing me their product called “Centralized Java (CJ)”. With this solution it is actually possible to run a JavaFX application in a browser (for now it works best with Chrome).
The website javafx-samples.com shows several demos that are using this technology. The demos include the JavaFX SceneBuilder, the game 2048, the JavaFX Ensemble demo suite. It is amazing how much of these applications is supported by CJ. There are still a few gaps but the folks at Sandec are planning to close them soon.
CalendarFX running inside Chrome
CJ hosts the application on the server and serializes the JavaFX scene graph. The graph is then sent to the browser and recreated by JavaScript. So you basically end up with a JavaScript rendering engine for JavaFX. Very cool!
CJ even supports a mode called “MultiView”. With this it is possible to share a session with several people, very similar to (for example) TeamViewer.
CJ is one step more for fulfilling the vision that the same code base can be used for any client.
Edit: I have uploaded a video to YouTube showing CalendarFX running in Chrome.
This could be good. Really good… Depending on performance.
Questions you may be able to answer:
Do they support streams?
Do they support lambdas?
Is a beta (paid or otherwise) available?
This definitely sounds very cool! Thanks for posting! Any info on if Sandec’s CJ will eventually support JavaFX 3D?
Nice. Hope to see more of it. 🙂
Things like this existed in Swing and never took off. I used Echo2 back in the day which had a similar architecture and it just never worked well. I tried the website and its nice to open ensemble like that but even now the inherent problems are visible.
If you lose server connection things start to get flaky, customizing the components in any way becomes a hassle and the underlying JavaScript is unreachable. So effectively you have something that provides no real advantage over desktop programming and brings a lot of baggage into the web…
We actually did a proper JavaScript port of Codename One using TeaVM which is an amazing JavaScript AOT VM for Java that even supports java.lang.Thread! We then implemented CodenameOne entirely on top of Canvas and that allows it to run embedded in the browser without a server e.g. check out our solitaire demo in the demos section of the site.
I don’t think something like this can be done in JavaFX because of the level of complexity inherent in to it. When I worked at Sun we tried to Map the FX scene graph to SVG (so we can work on mobile devices that support SVG) but that was pretty insane and I don’t see that happening.
@Sean the application is running on the server with full Java 8 support, including streams and lambdas.
@Sean please contact the guys directly and ask them for a beta (license).
@John regarding 3D. We talked about it but I am not sure what the status is. Currently AFAIK it does not support 3D.