3 ms·
Eclipse actually uses SWT, the least terrible Java UI framework! But making a cross-platform UI framework is just fundamentally difficult, it seems, and is alwa
by ptx 8y ago
Eclipse actually uses SWT, the least terrible Java UI framework! But making a cross-platform UI framework is just fundamentally difficult, it seems, and is always a compromise.
With SWT, the upside is that you get native widgets that look and work like they're supposed to on the platform, but on the other hand, if the same widget can appear with different sizes, looks and behaviours it's difficult to customize it, align it nicely and ensure the whole design behaves coherently.
With Swing, the other terrible Java GUI library, you get the same look and feel everywhere, but that look and feel is wrong on every platform. As well as slow, ugly and (still!) full of bugs.
Here's a fun Swing bug I noticed yesterday in IntelliJ:
1) Put IntelliJ somewhere in the middle of the window stack, i.e. with some windows under it and some above it.
2) Switch to a different virtual desktop. (Tested in Xfce on Debian.)
3) Switch back to the desktop with IntelliJ on it.
You will find (or I did, at least) that IntelliJ has moved
a) to the bottom of the stack, if using Jetbrains' bundled JRE;
b) to the top of the stack, if using Debian's JRE.
Some Java developers like to claim that it's just everyone using it wrong, but Swing is stuffed with these focus-related bugs. I've seen them in every Swing application now and then, for decades. (It also likes to create windows at the wrong position only to move them to the right position, and draw things initially with slightly wrong layout and then redraw them with the right layout. You can observe this as well in IntelliJ when it starts up.)
- pjmlp 8y agoYes it is using it wrong, because while some issues are indeed Swing interop bugs with the host GUI, others are lack of skills by not reading canonical books like "Filthy Rich Clients", written by Chet Haase and Romain Guy, the guys that drove most of Android rendering stack. Romain Guy's team recently released Filament, https://github.com/google/filament https://github.com/google/filament Back in the Sun days, Romain had a blog about writing nice looking Java UIs, which eventually lead to the "Filthy Rich Clients" book publication.