6 ms·
Ask HN on Show HN: Why is Swing UI still so Ugly ? 2 Decades since it's introduction in 1997 ( I remember being forced to use it in a trading OMS application i
by justboxing 9y ago
Ask HN on Show HN: Why is Swing UI still so Ugly ?
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.
- westoncb 9y agoPart of that is because Java has basically moved onto JavaFX over Swing—and partly it's because I built this specifically to resemble old Swing apps :)
- gruez 9y agofollow up question: why does swing use its own special snowflake design, when it could the OS's native design?
- westoncb 9y agoSwing uses a pluggable 'look and feel' system (essentially themes)—which does include a 'native' look and feel for various OSs, including Windows and macOS.
- AnIdiotOnTheNet 9y agoConsistent look & feel between platforms.
- hota_mazi 9y agoWhich means it sucks and looks weird on all platforms. The story of Swing.
- AnIdiotOnTheNet 9y agoWhich do you care more about: it works, or it looks good? There's a reason Java became such a big platform for business applications and it isn't because it cared about fashion fads.
- hota_mazi 9y ago> There's a reason Java became such a big platform for business applications and it isn't because it cared about fashion fads. 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.
- erikbye 9y agoCompletely failed? JetBrains' IDEs seem awfully popular, and they are all Java and Swing.
- megaman22 9y agoJetbrains IDEs could almost have an NCurses GUI, and they would be worth using. How pretty they are is mostly orthogonal.
- hota_mazi 9y agoCan you name another very popular and very good looking Swing application? 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.
- hota_mazi 9y agoBecause Sun made the boneheaded decision (and never admitted it was dumb) to go for emulated widget controls instead of native ones. What this means is that they have had to reimplement and imitate the behavior of native controls on all platforms (realistically, Windows only) every time Microsoft came up with a new version. 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.
- lmz 9y agoThe toolkit based on native widgets existed before Swing. It was called AWT.
- n3dst4 9y agoAWT wasn't native either - it just had one ugly appearance and couldn't be themed. I seem to recall it kind of resembled Sun's CDE (Common Desktop Environment) so it would have look sort of at home on Solaris.
- pvg 9y agoAWT uses native widgets.
- hota_mazi 9y agoAWT isn't native, it uses peers. 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.
- pjmlp 9y agoBecause most developers don't bother to read Sun tutorials and books like "Filthy Rich Clients".
- mhd 9y agoI'm a big fan of FRC, but a lot of those techniques are about "special-case" UIs, the way you see them in Web UIs or "multimedia" applications, not pleasing form and widget layouts. That's a bit of an intermediate step between just spewing forth UI elements and constructing fluid animated, mirrored list displays. And sadly often neglected, especially if your tools don't take care of it automatically (layout engines, Interface Builder etc.). Java and Tcl didn't have to look that bad, but sadly they often do. Or, well, one could just use JGoodies ;)
- pjmlp 9y agoI agree with you. 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.
- _pmf_ 9y ago"Filthy Rich Client" only shows how to do it, but it's still much, much harder than in QML (even Qt Widgets supported CSS styling) and WPF. I would say by a factor of at least 5 regarding QML and slightly less for WPF.
- pjmlp 9y agoYes, but it was possible. Not reading such books, just meant many devs were totally unaware of how to do it.
- abiox 9y agointellij is swing and it looks decent. i think it's because most people don't spend any time on appearance.
- pvg 9y agoIntelliJ is what a Swing app might look like after more than a decade of work and shipping (at times) with a custom-built JRE. It's not an effort most can and should spend to get to 'decent'.