fn-fx / fn-fx

A Functional API around JavaFX / OpenJFX.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use HTML as frontend

AxelRHD opened this issue · comments

Support Question

I wonder if it is possible to use HTML as frontend?

JavaFX provides a technology called "FXML" that seems to serve a similar purpose. FXML can be used within fn-fx as described here, though it could be supported more idiomatically (see issue #62).

Why would you want that? Or to be more precise: how do you want to use HTML in JavaFX?

Maybe JavaFX could have chosen to use HTML for the UI description (or a subset or it), though I hardly believe that's even possible. The fact is that they didn't, and I understand why. Beyond the technical difficulties it would have been of questionable value. Electron already gives you the possibility to do HTML UI on the desktop, the only thing missing there is proper multi-threading. HTML has many flaws, you use it because there's no alternative on the Web, not because it's a good piece of technology.

On the other hand, it may be useful to embed a piece of HTML UI in a JavaFX application (similar to the WebView in Android). That would basically mean you need an embedded Browser as a JavaFX component (which most likely will be a native thing) and with some integrations. But I don't know if something like this exists.