5 ms·
This looks very cool. What Java framework(Swing, FX etc) would you recommend for a desktop Java app?
by victor106 5y ago
This looks very cool.
What Java framework(Swing, FX etc) would you recommend for a desktop Java app?
- shannah78 5y ago> What Java framework(Swing, FX etc) would you recommend for a desktop Java app? Up to you. Swing is old faithful. JavaFX will result in something that is "cooler" and more modern. Both are supported. If you select "JavaFX" in JRE requirements, it will automatically use a VM with JavaFX to run your app so there's no penalty in app size for using JavaFX. If you are looking to target mobile, and also want to deploy to Desktop, you might want to check out Codename One. (Full disclosure: I work there). JavaFX and Swing aren't the only games in town either. jDeploy is part of my desire to make Java a more compelling choice for desktop app development. I still think it is too complex and overwhelming for new comers who just want to make a desktop app. I have some thoughts on how to simplify this, but I'll save that for another thread.
- brianguertin 5y agoThere's an exciting desktop port of https://developer.android.com/jetpack/compose https://developer.android.com/jetpack/compose done by Jetbrains: https://github.com/JetBrains/compose-jb https://github.com/JetBrains/compose-jb
- ta988 5y agoIt is exciting but even less there than JavaFX unfortunately. That's the problem with most UI systems, they evolve really fast in the beginning and show great promises, then the real difficulties arise and you have users that start to want a stable API.
- danieldisu 5y agoThe thing is that Compose is becoming the de facto UI toolkit for Android, and there is A LOT of really smart people working on it (both at Google and Jetbrains). Maybe I'm over-hyping it, but I really doubt there has been a UI toolkit with that much work behind in a long time (Maybe Cocoa and one of the last 3 iterations of UI toolkit on Windows had that many work hours, but Cocoa does not work in all OS and the Windows ones well ... :shrug:)
- brabel 5y agoArguably, Flutter has had even more work done... it's incredible how Flutter tools work so beautifully on all OS's. I've played with Compose for Desktop and it's basically the Android framework, but running on desktop, as you might expect... but the tooling is currently not anywhere as good as Flutter IMO... and the customizations to make apps look like actual desktop apps (rather than mobile apps on Desktop which is just horrible) is currently impossible because there's just no docs on how to do it or any library that helps achieve that that I could find... Flutter, on the other hand, has multiple "themes" that work well on Desktop... I was amazed to watch a YT video where a Flutter guy showed how he implemented a Windows 3.1- like theme for Flutter and re-created a really old app for a customer that, for users, looks just like the old one (which was a strong requirement by the customer!).
- danieldisu 5y agoI was thinking that this combo can really change the native desktop development landscape, it's still too early to tell but if you can solve development speed, performance, looking good and easy deployment in one stack it would really improve over Electron based apps.
- shannah78 5y agoI agree. Once you fight through the initial project setup, and solve the deployment difficulties (jDeploy), Java is a remarkably good platform for Desktop development. The sheer number of libraries available to you with a simple copy/paste dependency snippet, is unrivalled in any other ecosystem.
- SeanLuke 5y agoIn my opinion, JavaFX is the Duke Nukem Forever of UI toolkits. It was supposed to be a "modern" replacement for Swing, ultimately blooming into a full-featured, rich GUI library. But it's now almost 15 years since JavaFX was introduced, and Swing is still much more capable and flexible. I would pick Swing over JavaFX in a heartbeat for a new app right now.
- Ingon 5y agoAlso, Swing is just there, so for a simple app you don’t need to figure out dependencies or how to fit JavaFX into maven/gradle.
- shannah78 5y ago> figure out dependencies or how to fit JavaFX into maven/gradle. I struggle with the same thing. jDeploy solves one half of that (deploying javafx is no longer a struggle). I think there is still room to make creating new projects simpler.
- brabel 5y agoDon't do that, use a JVM that includes JavaFX, as this project seems to do. If you use SDKMAN, there are a couple of vendors, including Zulu, that distribute the latest JDKs with JavaFX included.
- alex_suzuki 5y agoLiberica too. Crucially they als have a 32-bit Windows build.
- whartung 5y agoI haven't seemed to be running into any problems ... yet ... with JavaFX maven dependencies. It pretty much Just Works(tm). A single main dependency (org.openjfx/javafx-control) and a plugin (org.openjfx/javafx-maven-plugin) and you're off to the races. I don't install JFX into the JDK at all (not even sure, honestly, if that's still a thing). I have more problems with JDK 9 modules (which modern JavaFX seems to support, but good luck with much of anything else of size). Since I am pretty much awful at GUI programming, I've made a lot more progress with FX on my home projects than Swing. It's no panacea, but it's been working for me.
- deleted 5y ago[deleted]
- tannhaeuser 5y agoFWIW, there's JetBrains's JetBrainsRuntime project [1] containing Swing patches for eg HiDPI support and other things. Haven't worked with it, nor do I have a stake in it; just mentioning it because JetBrain are one of the few companies delivering kick-ass, commercially successful, mainstream desktop software using Java/Swing today. [1]: https://github.com/JetBrains/JetBrainsRuntime https://github.com/JetBrains/JetBrainsRuntime
- kaba0 5y agoIs there a reason these are not getting backported to OpenJDK? I know that jetbrains do contribute a bit, but I feel like their model of having way out of date jdks shipped (offering worse performance then available) is not a good one. (They just recently switched to 11, and was still using the old concurrentms GC, over which G1 runs circles, let alone ZGC)
- MrBuddyCasino 5y agoIts possible to run IntelliJ with a Java 17 runtime now, not out of the box but there is a download somewhere.
- gjvc 5y agoIt is absolutely awful by default; IntelliJ apps are slow to the point of being unusable out of the box. The good news is that it is easily fixed (at least for my use case). I have tinkered a bit and running them on JDK16 or later, with JATOC has been a life-saver for me the past year, and reduced my paying subscription to an act of charity. "Develop with pleasure" is well and truly dead until they make the out-of-box experience FAST.
- brabel 5y agoWhat are you comparing against? VSCode with a ton of plugins to almost match IntelliJ? Because that's a lot slower than IntelliJ in my experience, not even close... I am currently using IntelliJ heavily at work and I would agree it was too slow for a gigantic project we have... but there's literally no alternatives that work nearly as great (Eclipse, Emacs, VSCode, tried them all, they mostly can't even load a project like ours --- Eclipse can but it's a pain to index everything on re-builds)... but since I got a Mac M1 Pro, IntelliJ again feels light and snappy :D unfortunately, having the best hardware possible seems necessary now, as ever.