Show HN: Hacker News desktop application in Kotlin/Swing
github.com
github.com
I would really like to see a non-trivial app built on JavaFX in Kotlin, with the following properties:
- Does not look ugly.
- Is not composed of _merely_ OEM widgets. But includes custom elements, like one would normally see on websites (and by extension, Electron apps).
- Is lightweight and response, not just in terms of CPU and RAM, but in terms of user experience (think VSCode vs Android Studio).
Gluon is taking a pretty neat approach with javafx (think reactive native with javafx):
I haven't browsed their repos but if you were to look for anyone promoting jfx it would be these guys.
Additionally, their design are bad(I mean their Java API).
We spend a whole year making an app with it, at the end we decided move away from it, like the rest of the java community if fact that do not really support desktop applications anymore.
I don't see why the custom XML should be a problem. Definitely you are not supposed to edit the .fxml files by hand, especially when you have apps like Scene Builder that allow you to design everything from a GUI.
> And it requires custom CSS too.
That's true only for a few JavaFX-specific properties. The CSS syntax doesn't change very much. Also, it's not a surprising feature: QT, the C++ GUI framework, also uses custom CSS.
I started with swing then shortly thereafter switched to JavaFX and it was a joy to use it for this usecase. Really easy to make what we needed in small amount of code and it is performing well and is really stable (runs 24h/7 without problems)
She's looking for work at the moment if anyone knows of someone who might want to hire a somewhat junior but very smart developer with a good sense of humor. See here for more: http://coribeecroft.com
Hope she lands a great job.
Just joking. Good job. I think it’s been years seen I saw a Java App, and have to say, I am a bit disappointed at how Swing still looks.
2 Decades since it's introduction in 1997 ( I remember being forced to use it in a trading OMS application in 2002), Swing UI looks frozen in time, ugly as ever.
The story of Swing.
There's a reason why Java completely failed on the desktop: Swing.
> Which do you care more about: it works, or it looks good?
Both. I care about both. And you should too.
But Swing developers got used to only being able to have one. At most.
Even if you can, you can count them on one hand. Swing was a massive failure, and rightfully so, because Swing/JavaFX apps look, and more importantly, feel, like a broken mess.
In contrast, SWT/JFace apps look a lot more native and feel extremely snappy. Apps build on the Eclipse RCP are in general pretty decent looking and they enable all the native controls and functionalities of the host platform.
Why? What value is looking good? There's value in a well designed responsive UX, but how it looks is completely meaningless to me because it doesn't help me get shit done.
If you are going for non-native widgets, they should at least look good. Otherwise you get the worst of both worlds.
In contrast, IBM took the native approach with SWT / JFace, and the interfaces written with that library look and feel infinitely more native and performant than Swing and JavaFX ever did and ever will.
The fact that Swing ended up being such a massive failure was in good parts due to the fact that Swing is built on top of AWT.
Or, well, one could just use JGoodies ;)
Still it is a kind of first step.
Tooling was the major problem. Swing could be made to look as nice as WinForms, but defaults matter when developers are lazy.
Android is another example where if one wants to make cool Material design applications, some UI programming skill is needed.
Not reading such books, just meant many devs were totally unaware of how to do it.
The secret is to read "Filthy Rich Clients" and "Tricks of Swing Gurus", where most of those programming knobs were described.
Is there any way to customize the theme? I'd love something that's more clean and looks more modern.
Thankfully JavaFX is pretty easy to customise, it's roughly writing CSS, and there's a few high quality themes out there. Take a look at JFoeniX[0] for example for a material design inspired look.
The problem is that most devs don't bother to read the Sun tutorials and respective UI/UX blogs on java.net, or books like "Filthy Rich Clients".
Actually, an app not using much memory may be sacrificing performance by not using a caching opportunity.
Unfortunately, apps coordinating how much memory to best use is an unsolved problem, as far as I know.
Other ways to read Hacker News | https://news.ycombinator.com/item?id=15310291 (Sep 2017, 181 comments)
Includes mention of alternate websites, mobile apps, and a pair of CLIs: haxor-news and hn-cli. I'm not sure but this might be the first desktop GUI app for HN I've heard of!
"It Don't Mean a Thing (If It Ain't Got That Swing)" https://www.youtube.com/watch?v=qDQpZT3GhDg
:)
Edit: it also may look different if you aren't used to seeing the 'Nimbus' Look and Feel—its JTree looks fairly different.
1) don't start a new project in Swing when you could use JavaFX instead. Since you're using Kotlin, you'd also want to use TornadoFX, a nice DSL for JavaFX.
2) use Maven or Gradle (or hell, any build tool). Don't store artifacts in source control.
I was really hoping someone who knew what they were doing was building this after the mini Electron debate earlier this week :/
As for building—I agree the current project structure is basically unforgivable :) However, I figured the chances of anyone seeing the project were extremely remote and it was just for fun so I didn't bother with any of the boring stuff. Maybe I'll fix it up a little now though.
EDIT: the project now uses Maven.
Now that you've got a build.system in place you won't have to waste time documenting or replying to comments about how to build it :)
Java desktop apps seem almost universally awful, but it doesn't seem like it has to be that way. I'd love to see some counter examples (IntelliJ's IDEs are honourable exceptions, but they're a bit of a special case).
I always note with irony that professionals expect to pay decent money (Bitwig is $400) for software relevant to their trade; the one exception being software pros.
Also, there's LoadFX (a logging viewer) which was part of the rage post against Electron last week: https://github.com/renatoathaydes/LogFX
And Gluon keeps a list of sample apps: