0

I am interested in Kotlin GUI system and I found Tornado FX.

I noticed that we can transform javaFX app as a webapp, so my question is : Can we do the same with Tornado FX and if we can, How should we do that?

charles Lgn
  • 500
  • 2
  • 7
  • 28

1 Answers1

4

Anything you can do with JavaFX, you can do with TornadoFX, as it is basically a higher level API on top of JavaFX.

JavaFX itself has no rendering capability that targets the web, but JPro has rather geniously made that possible by "rendering" the JavaFX UI as SVG directly to the browser using WebSockets.

Infact, TornadoFX has special support to make it easier to create JPro based apps.

Your starting point would be https://www.jpro.one/

The TornadoFX guide contains information about how to use JPro as well:

https://github.com/edvin/tornadofx-guide/blob/master/part2/Scopes.md#using-tornadofx-with-jpro

JPro is a commercial offering, starting av 99 EURO per month for one server with 8GB memory at the time of writing (2018-11-20). Each user would get their own instance of the application, though still running within the same JVM.

While this system works remarkably well, it is best suited for situations where there is low latency and preferably high bandwidth between the client and the server, as every event will be transferred over the WebSocket connection. It would typically be a bad choice for a public facing web page, but it is doable. In fact, http://jpro.one is actually a JavaFX app!

Disclaimer: I am not affiliated with JPro, I'm merely telling you about the (only) way to make JavaFX apps available through the browser.

Edvin Syse
  • 7,267
  • 18
  • 24
  • I don't say it is the best way but I saw an [Oracle Document](https://www.oracle.com/technetwork/java/javase/javaclientroadmapupdate2018mar-4414431.pdf), a [stack of JFX on Browser](https://stackoverflow.com/questions/19102000/javafx-can-it-really-be-deployed-in-a-browser) and an explaination of oracle to [run as a webapp](https://docs.oracle.com/javafx/2/get_started/basic_deployment.htm) so it is maybe possible no ? – charles Lgn Nov 21 '18 at 09:03
  • 1
    That document is talking about deployment through a web browser, not actually running the application in the browser. JNLP deployment is still supported, but does not actually use the browser to run your application. – Edvin Syse Nov 21 '18 at 11:56