r/java • u/sombriks • Sep 28 '26
State of Java Desktop
Thinking about local-first, desktop applications. https://sombriks.com.br/blog/0097-state-of-java-desktop/
81
Upvotes
r/java • u/sombriks • Sep 28 '26
Thinking about local-first, desktop applications. https://sombriks.com.br/blog/0097-state-of-java-desktop/
31
u/bobbie434343 Sep 28 '26 edited Sep 28 '26
JavaFX can be made to look very good and modern with AtlantaFX. And thanks to the recent jfx-static project, it is much easier to bundle a JavaFX program as standalone executable with GraalVM's native-image, taking less disk space, running much faster (especially startup) and using way less memory. The AtlantaFX Showcase (sampler) is a good demo of this (build it with
-Pnative).If I had to make a desktop Java app today, that's the combo I would use: JavaFX + AtlantaFX + native-image.
Swing can still be useful and is leaner than JavaFX (+ is bundled with stock JRE), but its graphics are not hardware accelerated (that's one of the main reason it uses less memory) and might have problems on HiDpi monitors. It is also not compatible with native-image (at least not easily).
13
u/hippydipster Sep 28 '26
JPackage is nice, but very limited and imperfect, especially on linux, which is why I use Conveyor which does a better job overall.
What would be nice is to have Linux desktop and java desktop play a bit more nicely together. Right now, it's really hard to deploy an application for a linux distro like Ubuntu that adequately deals with the application icon in the tray and after starting up.
And beyond that, if one wanted to deploy a suite of applications under a single distributed JVM, that also is very difficult to arrange with these tools.
9
u/lazystone Sep 28 '26
Didn't know about https://github.com/tamboui/tamboui - I really would like to try it for something.
4
u/Terrible-Falcon-917 Sep 28 '26
Only compose
4
u/Infamous_Sorbet4021 Sep 28 '26
Here is another discussion taking about building JVM desktop apps: https://www.reddit.com/r/Kotlin/s/idhfLh53NR
5
u/mellow186 Sep 28 '26
SWT/JFace is less effort than suggested by this article, if you use the forms builder WindowBuilder SWT Designer.
And it looks native. And there's a plethora of third-party components. Such as one of the most powerful, performant table frameworks, NatTable.
4
u/Gleethos Sep 28 '26
I recommend: https://awesome-java-ui.com/swing-tree.html
2
u/jeffreportmill Sep 28 '26
You should include a section about CheerpJ. The only thing better than a good installer like jpackage is not having to install the app at all and just click on a link in the browser. If you post the jar to the ToDo app on a website and add a simple 10 line html, you can launch it in the browser.
2
u/jNayden Sep 28 '26
Codename one works on desktop right ?
4
u/segv Sep 28 '26
Looking at the current trends, regular desktop applications seem to be a dying breed.
Apps like VSCode, Discord, Syncthing or KopiaUI (just to select few keeping broad spectrum) do have desktop clients, but that client often is just a chromeless webview that displays de facto web page that is "the app".
I believe that the requirement of having clients for multiple operating systems (including mobile) pretty much killed oldschool desktop applications, save for few specialized niches like video editing or CAD.
Not saying this is a good thing, but that's the trend i've been observing in these past few years.
Edit: Just to be clear, this seems to be a general trend, not "just" a Java thing.
1
u/SpicyRomek 1d ago
Disclosure: I work at Vaadin.
If you want "no install, just a link" without running Java in the browser, Vaadin's SwingBridge does the opposite of CheerpJ. The Swing app keeps running unchanged on a server JVM. SwingBridge streams only the changed screen regions to the browser and replays clicks and keystrokes on the real Swing components. So there's no client-side JVM or WASM, and no rewrite. It also runs NetBeans Platform apps.
Because the Swing app is hosted inside a Vaadin app, you can then replace views one at a time with Vaadin views written in Java, and call between the old and new code. It's a bit like what u/bfoo described doing with JavaFX inside Swing, except you end up on the web.
Trade-offs, so nobody's surprised:
Docs if anyone wants to poke at it: https://vaadin.com/docs/latest/tools/modernization-toolkit/swing-bridge
1
u/TheLineOfTheCows Sep 28 '26 edited Sep 29 '26
If your target is Windows only then C# should be your best option. I wouldn't choose Swing or JavaFX for that aim.
1
u/Kango_V Oct 05 '26
Writing TUI apps that can run on our locked down jump boxes/bastions which are terminal only. Using Tamboui, PicoCLI, Micronaut and GraalVM. Very satisfying being able to run them pretty much anywhere.
1
u/vmcrash Sep 28 '26
I'm developing different Java desktop applications since 27 years, initially Swing based, since 15 years SWT based. Each has its serious problems.
For new desktop projects I would evaluate different programming languages with different frameworks. Why a different programming languages? Because I think that re-compiling (JIT) on each application restart seems like a waste of energy for desktop applications. And I like PLs without semicolons or without mandatory braces for the if- and other statements. 😉
1
u/paul_h Sep 28 '26 edited Sep 28 '26
JavaFX example should really be the nested DSL in my opinion. Java/Swing should do it's darndest to get to the same place - https://github.com/paul-hammant/swing_component_testing/blob/master/src/main/java/demo/Demo.java
-1
u/SaishDawg Sep 28 '26
Just musing, but I would probably write a local desktop daemon in Java, use Protocol Buffers for RPC and have the actual app as Tauri: https://github.com/tauri-apps/tauri. But lots of ways to skin a digital cat.
28
u/[deleted] Sep 28 '26
[removed] — view removed comment