Home to Anything JavaFX Related
jfx-central.com
jfx-central.com
While I've used JavaFX on non-trivial projects, the momentum for UX definition seems to have swung towards HTML/CSS. To combine HTML/CSS layout with Java frontend logic, I have switched to Flavour ( https://flavour.sourceforge.io/ ) for all my new projects. (Disclaimer: while I didn't create Flavour, I'm now the maintainer.)
Flavour lets you make fast-downloading single-page apps, like Wordii ( https://frequal.com/wordii/ ). It's easy to get started, there's a maven archetype and easy instructions at https://flavour.sourceforge.io/. Much more documentation is in the Flavour book: https://frequal.com/Flavour/book.html
But maybe now, that we have GraalVM Java will make a comeback to desktop?
I remember reading that they were removing it from the JDK so it wasn't tied to Java release schedules, enabling them to have more frequent updates. Don't know how it worked though, but where I live I know, by reading job offers, that at least a couple of companies use it.
what would be replacement?..
Now I'm on different company and mostly work on Android apps. Practically see zero demand for desktop apps nowadays. Well, perhaps for personal projects, then :)
Ad 2024 the framework is seriously behind any other commercial GUI be it WPF or Qt. I found the SceneBuilder to be highly unstable, crashing often several times during development.
The idea to use CSS for styling is not bad, but there is absolutely no autocomplete in IntelliJ Community for it. Makes writing it hard. There is a JavaFX plugin for Eclipse but it looks abandoned.
All in all it works when you need to put a simple GUI for your hobby project but I would not recommend it for any serious app.
Then I remembered some years ago, in this similar situation, I decided to learn (invest time on) JavaFX when Qt, gtk, Xamarin and web tech were the alternatives.
Well, yesterday I googled, after all these years, if JavaFX apps can be run on Android devices (spoiler: no, or not in a usable way)
Now, in hindsight, I know that I put my egg on the wrong basket by focusing on Java and JavaFX. I was deluded on their write once run everywhere promise. I feel betrayed by Oracle due to their detaching of JavaFX from default JDK.
I think if I chose to focus on a web tech frontend framework (or even Qt) I'd been better off.
Thanks for coming to my Ted Talk.
Why? Didn't removal of JFX from default JDK just meant that developers are expected to bundle their own thin custom-built JREs alongside the application? So that the applications will run on systems that don't have a JRE installed, or their installed JRE is too old.
E.g. JetBrains distributes their own JRE with Idea, which contains bundled JFX. Or, they did it in the past, not sure about today.
After hearing (from Oracle) in the early 2010s about how JavaFX was the future of GUIs in Java, I can identify with the feeling of betrayal when it was unceremoniously removed from the JDK. If I'd known that was coming, I wouldn't have added JavaFX to my Swing application.
Nowadays we know that there are Bellsoft and Azul (is ZuluFX still a thing?) JVMs that still ship with JavaFX, but when Oracle made that announcement, we didn't know that, There were a couple years there where it looked like a significant refactor to externally linking OpenJFX, and shipping one-distro-per-system instead of one JAR, would be needed to move past Java 8. Now it's not so bad, I still target Java 8 as a minimum, but can point my program's users to the Liberica JDK and everything just runs.
> I feel betrayed by Oracle due to their detaching of JavaFX from default JDK.
I really find this to be extremely odd. It’s simple to add back as a dependency in your build file. Or just use a build like Azul’s which includes it in the runtime.
* Building installer-free cross-platform binaries on a local Linux build machine requires an external packager[2].
* Good luck building an installer-free binary for CPU architectures that differ from the compiler's machine.
* Creating a Windows version will cost $ (to sign).
* Creating a macOS version will cost $ (to sign).
* WebView is a bloated beast that bundles JavaScript and exposes no API to set scrollbar positions.
* FlyingSaucer[3] is a lightweight alternative to WebView, but requires a SwingNode.
* SwingNode text rendering is blurry on Windows.
* SwingNodes issue GDK-3 warnings on Linux.
* Menu latching messes up cross-platform (Alt+Tab is a wrench).
* Modular applications are a pain. Migration has been poorly communicated, poorly documented, and poorly supported.
* RichTextFX has no way of changing the caret style in insert mode.
* PreferencesFX, and likely other FX libraries, has security issues.
* For MDI with dockable panes, take a look at tiwulfx-dock[4].
Java problems:
* "Write once, run anywhere" is no longer true.
* Apache Batik for rendering SVG images is buggy, EchoSVG[5] is better.
* Rendering math as SVG is hard[6].
* Cross-platform user data directory that complies with XDG, Windows, and macOS will take effort.
* Reliably locating executable programs across platforms is a chore.
Depending on your requirements, C++ and imgui may be a better choice.[7]
[1]: https://gitlab.com/DaveJarvis/KeenWrite
[2]: https://github.com/Reisz/warp/
[3]: https://github.com/flyingsaucerproject/flyingsaucer
[4]: https://github.com/panemu/tiwulfx-dock
[5]: https://github.com/css4j/echosvg
[6]: https://gitlab.com/DaveJarvis/KeenType
[7]: https://github.com/ocornut/imgui/issues/4400#issuecomment-89...
I have done a ton of Swing over the years, and also a 2.5D zoomable scene graph API called Piccolo2D [0], which was one of the inspirations for JavaFX (or so I heard at the time).
As far as your advice, I will take a look at swapping Batik out for EchoSVG, and also see how you tackled the user data directory issue in KeenWrite.
You fell trees with saws, not hammers.
I cannot imagine electronjs having the chops to implement KeenWrite.