3 ms·
As someone who used to like JavaFX and maintain a few desktop apps that use JavaFX, I have to say you're totally right. Google seems to be putting huge amounts
by brabel 7y ago
As someone who used to like JavaFX and maintain a few desktop apps that use JavaFX, I have to say you're totally right.
Google seems to be putting huge amounts of effort on Flutter, and it can already run on the desktop (still early stages and in alpha I believe)... JavaFX is mostly orphan right now. Oracle seems to have no interest in it... so it seems to be currently being mostly advanced by Gluon[1], which honestly, does not have the muscle to pull out something competitive with Flutter or Electron.
JavaFX still has fundamental pieces missing... like setting an icon for the app or opening some URL in the system browser[2] (without using horrible hacks, which is what I've been doing - which get you lots of warnings since the module system was introduced, and may stop working soon). Not to mention no support for auto-updates, the fact that jpackage is still in "incubator" stage[3] and intentionally does not have JavaFX-specific features at all (it's just barely usable with JavaFX), the SceneBuilder, which could be such a great tool to develop UIs, similar to Lazarus, but it's nowhere as good, being in about the same unfinished state it was in around 2014, terrible documentation and lack of adoption (most examples you find online are from circa 2015, when JavaFX got a little traction)...
These things all make JavaFX a very hard sell for non-developers apps (if you're a developer who does not mind installing the appropriate JVM version to run the app, JavaFX works quite well - a 1MB jar can give you A LOT of features - one of my apps, my favourite and really useful, is only a 340KB single jar and works on any JVM 8+ - and looks as modern as any Electron app).
It's sad but the best way to get professional apps developed and distributed nowadays seems to be, by far, Electron (because of JS, and its stupid browser-based architecture)... but I am hoping Flutter will break Electron's hegemony soon as I have great experience developing Flutter apps on mobile and the web... Just try the online pad[4] to get a taste of what it looks like! It's amazing.
[1] https://gluonhq.com/products/javafx/ https://gluonhq.com/products/javafx/
[2] https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8091107 https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8091107
[3] https://openjdk.java.net/jeps/343 https://openjdk.java.net/jeps/343
[4] https://dartpad.dartlang.org/ecb28c29c646b7f38139b1e7f44129b7 https://dartpad.dartlang.org/ecb28c29c646b7f38139b1e7f44129b...
- tosser678 7y agoHow does TornadoFX compare? it seems more focused on enterprise apps though
- brabel 7y agoTornadoFX is just a Kotlin wrapper around JavaFX. It makes writing apps much nicer, but has considerable cost in terms of even more memory usage and, obviously, due to the Kotlin runtime and lots of Kotlin wrappers for most JavaFX classes, app size.
- pjmlp 7y agoIn that regard I think React Native has much better future than Dart/Flutter, specially with Microsoft backing it now, unless Fuchsia actually gets released.
- hopia 7y agoWhy is that? You mean that you're worried about Google calling quits on Flutter sometime soon?
- pjmlp 7y agoFlutter is all about being the last opportunity to sell Dart, and I doubt that Chrome (PWAs) and Android (JetPack Composer) teams are that happy about its existence, given the political answers when questioned about Flutter on their own Q&A sessions.
- hopia 7y agoI don't think purely about Dart, originally it seemed to be aimed as a technically more robust cross-platform competitor to React Native. Its implementation has good merit in that regard. That said, it may well not survive nearly as long as RN will, time will tell.
- sdegutis 7y agoJavaFX seems like it was a good incremental step over Swing but right at a time when the web’s paradigm (the DOM, a brilliant concept) was becoming popular and was a leap beyond Swing. So JavaFX has the same problem as Windows Vista: too little too late. If we had something like the DOM as a new UI kit, it could be a big hit if done right.
- ptx 7y agoI'm not sure I see any real difference between the DOM and the tree of widgets you can build in Swing. What is it that's so brilliant about the DOM?
- sdegutis 7y agoThe DOM stitches several useful but unrelated concepts together. Besides just being a tree of composable views: * You can query elements arbitrarily deep using different patterns (depth, class names, ids, tag names, attribute presence/values). * You can attach event handlers to arbitrarily deep nodes that you just queried, not just the nodes at the level your "controller" is in charge of creating/updating like traditional frameworks. * Customizing style and behavior is entirely done via properties and composition rather than subclassing like traditional frameworks. * And more!
- graynk 7y ago> like setting an icon for the app As in stage.getIcons().add()? Or do you mean for the binary that jpackager produces? I wrap my apps with launch4j which allows that. Then I bundle them with jlink-made JRE (about 60 MB). Works pretty well, total size is ~100MB for the whole app with all the dependencies, (not a Hello World app by any means). >opening some URL in the system browser As in getHostServices().showDocument("https://google.com" https://google.com")? Then again, nothing's stopping you from using awt's Desktop class, not sure I understand the problem here.
- brabel 7y ago> stage.getIcons().add() Doesn't work and never did on MacOS. EDIT: bug (closed as won't fix!!): https://bugs.openjdk.java.net/browse/JDK-8095033 https://bugs.openjdk.java.net/browse/JDK-8095033 > opening some URL in the system browser HostServices also does not work in all but Oracle's distribution of JDK 8, which is abandoned now: https://github.com/javafxports/openjdk-jfx/issues/540 https://github.com/javafxports/openjdk-jfx/issues/540
- graynk 7y ago> Doesn't work and never did on MacOS. Gotcha, I work only with Linux and Windows. There was a problem where the icon was incredibly pixelated on Windows 7, but they fixed that. > HostServices also does not work in all but Oracle's distribution of JDK 8 I see, I tested it only on Bellsoft's JDK 11, since I don't use 8 anymore.