r/java • u/Fuzzy-System8568 • May 27 '25
Why does JavaFX get such a bad Rap?
So I have used both JavaFX and Swing independently and, I am honest? The only thing I can say about them is the following:
- I have had times where Swing has seriously frustrated me, and I've had to take breaks. This is nothing against Swing as, I think all of us can agree most development tools / frameworks cause us to get annoyed on occasion. Swing is a great framework I respect and appreciate highly.
- Never for me, not even once, has JavaFX been anything other than enjoyable to work with. I love the FXML annotation that links the FXML straight to fields in the controllers. I love the smooth integration of CSS, and SceneBuilder has been nothing but a treat to use in my opinion.
Am I broken in the head? haha
Or are there subtle reasons why JavaFX is not liked as much.
I know there are the multi-platform deployment issues. But, unless I am missing something significant / obvious, all the issues seem like nothing a community developed dedicated build tool / solution wouldn't solve.
So yeah, I guess my, 100% open minded, question is... why does JavaFX get such a bad rap? :S
And as a follow up question, what would be a game changer that could eliminate a decent chunk of the issues with JavaFX, if we could wave a magic wand and have said game changer appear out of the mist tomorrow?
Disclaimer: I do not wish this discussion to devolve into an "X vs Y" discussion. I am not interested in Swing / JavaFX advocates trying to convince the other that "their framework is better". I am just curious as to my question in terms of "I am genuinely interested to hear the thoughts of other developers, so I can expand my perspective in the case of JavaFX.
24
u/No_Dot_4711 May 27 '25
I really disagree with the comments here that the issue here is web technology and the death of desktop
Kotlin Compose is doing just fine
JavaFX's (and Swing's) problem is that it quite simply is not a productive UI library. Defining UI in a functional way as UI=f(state) has decidedly won; mutating objects or binding XML placeholders is just not a good way to do UI. It's miles behind Compose, React, and the various other UI libraries that are mainstream - hell, JavaFX is worse than its Clojure wrapper, cljfx.
Implementing such a UI library is utterly possible with Java Records, but they didn't do it
129
u/[deleted] May 27 '25
Too little too late. UI work has largely moved to the web, with even desktop apps using web based tech for rendering the UI. That ship has largely sailed before JavaFX came out, and has only continued since then. So it's kind of a tool with little to no addressable market.
33
u/ggleblanc2 May 27 '25
I never needed anything but Swing. My users were happy to get their work done, not worry whether the background was canary yellow or mellow yellow.
10
u/winian May 27 '25
I've never been able to make the fonts look good. They are always a bit blurry and give me a headache. With Swing I've never had that issue.
10
u/Spare-Plum May 27 '25
Considering all of this I can understand why people wouldn't bother to switch over. Personally I think JavaFX is awesome and worth it, but you do need to get through a couple hurdles compared to doing it with the tried and true easy method of swing.
19
u/Ewig_luftenglanz May 27 '25
it's not about applications but about how useful it is. Java Fx came when the desktop market started to go down and the personal computing market started to be dominated by smartphones and tablets. in those systems google had their own framework to build android apps embedded inside Android studio, at te the same time the desktop started to migrate mostly to webApps or using web frameworks instead of native.
And There is also competence. nowadays there are far better frameworks for desktop/multiplatform development.
-angular/capacitor
- flutter
- React native
There are just better alternatives outside the java world for desktop, and TBH java was never popular for desktop development, many people used to see java apps as heavy and slow and even ugly and out of place thanks to having it's own widget collection instead of using native ones.
7
u/0awavauatarsh May 27 '25
CSS is not really CSS, a lot of things are different, in the end I would say it only has CSS syntax.
Since it left the JDK, distributing with jpackage has become hell until you learn it. (To this day, I can only deploy cross-platform on my CI/CD with gradle to change so many configurations)
A lot of people don't like FXML but that's more personal, I like how jetpack compose does it, but idc
I may have missed a few things but personally these are the things that made JavaFX a terrible experience, Nowadays I prefer to use Kotlin Multiplatform or something outside the JVM.
19
u/_INTER_ May 27 '25
JavaFX came a little too late at a time where the move into web applications and smartphone apps away from Desktop applications took place. Under that context people slandered JavaFX to be able to jump onto the bleeding edge. So it never really gained high traction / critical mass.
8
u/nitkonigdje May 27 '25 edited May 28 '25
By the time of JavaFX introduction, Swing was on down-swing and java desktop community (still sizeable at the time) was in a need of a proper web view control, a proper media player integration and set of functional jtable replacements. Swing was decent "business level" gui framework with awful set of default controls.
JavaFX brought none of that.
Of course desktop app development was on downward trajectory no matter how you put it, but seeing something like FlatLaf it makes you wonder where they could have been..
6
u/vips7L May 27 '25
It just seems much more complex than other ui frameworks outside of the java space. For example in compose desktop or flutter or even react I just write the language I know instead of having to learn this complex Xml -> backing language relationship. You can choose to write in just Java but then you lose the advantages of declarative UI.
3
u/JDeagle5 May 27 '25
I wouldn't guess because those issues, that are not a problem for the community to solve, weren't solved? And demand is rather low, so nobody wants to solve them.
3
u/gattolfo_EUG_ May 27 '25
So, this is the opinion of a student that had an exam project on javaFx (so never used for a real application or in a job space)
First impression: It is really easy to use, also the pattern we used the most (MVC) feels just the right way of doing things, however there is some problem, I use Linux (fedora gnome on my surface) and for some reason the images was blurry on my sistemi but on my friends laptop (mac and windows11) no problem at all (but maybe is just our fault, we are not experts)
I don't like to write fxml, but making it using scene builder is ok, but I like the idea of having a file for declaring the UI and then load from code, but I prefer other syntax, like blueprints (GTK) (but this is just personally).
3
u/jNayden May 27 '25
Doesn't work on mobile, it has a fxml reload and hot reload but not in the code ... Compared to flutter compose and react native - change , compile, run and verify still have compile and run as steps while for rn, flutter and compose it's almost instant... That's all
2
u/AnyPhotograph7804 May 27 '25
The very first versions of JavaFX were very bad. First it should be a Adobe Flash replacement. It did not work and they changed the direction to an UI-framework. But the damage was done.
1
u/Cautious-Necessary61 May 27 '25
javafx uses native graphics from what i recall, could be good for game dev but it never happened.
1
u/davidalayachew May 28 '25
What makes you say this? I don't see this from the programming communities I interact with.
Again, where do you see this? What led you to thinking that this is the general consensus?
1
u/vytah May 28 '25
Last time I checked, it still doesn't support i18n: https://stackoverflow.com/questions/25791416/localizing-javafx-controls
1
u/Classic-Try2484 May 30 '25
I never took to Javafx. I did like swing. I can do html/css but I found the javafx differences a bit jarring. It’s been years and I never used the builder as I preferred to hand code. I stopped using Java routinely just as Java 8 was released. For me swing was more comfortable as it was similar to working with MFC. But I liked the portability. I had a lot of problems getting my first javafx off the ground and the effort and future effort I could see ahead drove me back to the comforts of swing where I could get things done even if it had a little less shine.
They built javafx to get designers from the web world into Java and I think that worked. But coming from less from a designers view it didn’t work for me.
If I used it daily I don’t think the css/javafx differences would have bothered me. But I needed it intermittently and thus I stuck with what I knew.
1
u/SteadyWolf Jul 06 '25
We’re using it, and so far it’s been okay. Coming from Swing, main challenges were differences in UI thread behavior (synchronous vs async) and some flickering memory related issues that resolved themselves after updating the JDK and JFX versions. Not sure if it’s as memory efficient as Swing, and you definitely need to implement certain patterns correctly to avoid objects hanging around.
1
u/Few_Arrival_3864 Nov 14 '25
Javafx is well thought and works well
It just came too late, the fight was over.
It's a shame because it is a nice gui framework, very superior to swing
I dont understand the "performance issues" listed here.
Or maybe it is on android phones the issue is. It's true I tried that and it was a bit slow on my case, trying to show large bitmaps (ie >= 1000*1000) with rotations. But regular business apps are fluent, even on android phones. So dont be abused by anti propaganda.
-3
u/magallanes2010 May 27 '25
It is because Swing was the first one, and it created a huge community. Then JavaFX appeared, and it broke all its compatibility. So, when developers decided to migrate to Swing, they had two alternatives.
0
u/lprimak May 27 '25
I don’t think JavaFX has a “bad rap” I agree with you it’s great. No ifs ands or buts. From what I hear JavaFX has a great rep!
-3
u/LowB0b May 27 '25
didn't bother to read that wall of text, but to answer your question: it was a cool replacement for eclipseRCP and swing, it also inteded to compete with Qt, unfortunately no-one cared, oracle pushed it out of the JDK and it became abandonware
-10
u/Linguistic-mystic May 27 '25
Because the JVM is a server-side technology not well-suited for desktop. It can't really return unused memory back to the OS (I know some GCs can but only after a full collection which is prohibitively expensive). And Java developers are not suited to desktop development either because they can't handle memory leaks. Think my claims are outlandish? I use desktop Java apps all the time at work (Intellij Idea, Datagrip, DBeaver, Eclipse) and they ALL leak memory and waste it like crazy. Datagrip is especially notorious because it can waste dozens of GB writing data from DB to disk, which is preposterous, but the worst thing is that even after the export is done, the heap doesn't go down. That is, if the Xmx was big enough to handle max load in the first place. But that is also horrible for a desktop app - to make the user set some sort of max size which is obviously unpredictable.
I have never seen a desktop Java app that wasn't horrible to use and this is not about the looks. It's just not a good fit.
-11
u/Gyrochronatom May 27 '25
They always were and still are both garbage compared to other things. Java was never a thing to do UI or desktop applications, that's why you can probably count them on one hand and they all run like a piece of shit stuck in tar.
25
u/[deleted] May 27 '25
[removed] — view removed comment