Hacker News new | ask | show | jobs
by efdee 2396 days ago
Good luck getting that Swing app to look nice, though. Which is a breeze with HTML/CSS.
3 comments

Customizing the appearance is one place where Swing's age shows. It is possible to create a custom "Look and Feel", but it is not as easy as HTML / CSS:

https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/

JavaFX does allow CSS to be used to style it:

https://docs.oracle.com/javase/8/javafx/user-interface-tutor...

I remember >10 years ago there used to be some "plaf" libraries that provided very easy themeing abilities for Swing that even came with a WYSIWYG tool to create themes. It is a shame something like that never became part of Swing itself and instead you have to create tons of classes just for a theme.
Or actually buy them.

http://www.jgoodies.com/ is still in business, to give a possible example.

This doesn't fix the issue of Swing theming being hard. The fix would be to make it much easier, preferably with a visual editor.
You mean like Netbeans Matisse, or more like actually having a designer on the team?
I was talking about themes, not UI design. Think GTK themes (though not their implementation), not where buttons in a form will go.
Not only it is a breeze, after reading books like "Filthy Rich Clients", I have full control over hardware acceleration instead of playing CSS tricks with Z ordering in the vain hope that the browser will do the right thing.

Lack of design skills doesn't improve just because one changes UI stack.

Swing can look fantastic if you put in the effort as IntelliJ (based on Swing) shows. I'm not necessarily an IDE guy, but good luck with getting that kind of functionality with JS on Electron even remotely.
I wouldn't say IntelliJ's stuff looks -good-. It's a lot more workable than most Swing apps but it's still a long way from looking "good".

That said I haven't touched their IDEs in 2 years so maybe something changed.

I'd say IntelliJ looks like it belongs on the platform it is run on - which I'll take any day over some over-designed cross-platform 'styling'.
The problem with Swing theming is that you need to create a ton of classes "just" for theming your application. I did that years ago myself, but really Swing should have something like those libraries released years (>10) ago that had a bunch of premade themes as well as WYSIWYG editors for them.

There used to be many libraries (most of them were awful, half of them tried to mimic circa 2002 Mac OS X Aqua) so i do not remember any names, though i remember trying one with a visual editor that i gave to a designer at the place i worked at. We didn't ended up using it though because of the price.