Re:Ask HN: Does Java need a modern Java UI toolkit for deskt...
by kaba0 on Friday March 25, 2022 @07:45AM
(#30800922)
Whaaat, no way. Sure, Swing is not the epitome of a framework, but the web was famously terrible before flexbox, and it is still not as advanced as something like Apple’s constraints based layouting system.
Also, word wrapping? HTML is quite terrible to read compared to Latex-rendered text so I wouldn’t say that it is all that good in fonts either.
Re:Ask HN: Does Java need a modern Java UI toolkit for deskt...
by mike_hearn on Thursday March 24, 2022 @12:33PM
(#30792181)
Swing isn't exactly the latest toolkit though, is it?
JavaFX has much more intuitive layout for apps than HTML and also has CSS. So you can get the best of all worlds. HTML5 has been trying to catch up with CSS flex-box, but it's all just retrofitted and shows.
As problematic as CSS is, getting things in the right place is still dramatically easier than with Swing LayoutManagers, and when you do have problems, you have great tools in the browser to explain what's going on.
Browsers particularly shine in text rendering, naturally; text styling, font selection, word wrapping, etc. are all easily configurable. You want bold text next to regular text in Swing? You either need two JLabels, or you wrap your text in <html> tags and let the embedded HTML 3.2 renderer do it.