News for hackers. Stuff that matters.
Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by islon on Thursday March 24, 2022 @10:17AM (#30790100)
Devs complaining that the JVM is too heavyweight for client applications when electron is dominating the desktop landscape.

Satire is dead...

Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by johntdaly on Thursday March 24, 2022 @10:31AM (#30790325)
I never “got” electron. My work is building webapps and I don’t see why anyone would want to use HTML and JavaScript to develop a significant desktop app with modern UI.

I can only assume web technologies and electron got popular because all of the Desktop platforms where trying to jump to tablets and phones and whatever else they considered new and shiny so that while web tech was a terrible stack it was at least stable.

P.S.: I sort of hope for Griffon to make a come back. Griffon framework + Groovy + JavaFX looked nice to me.

Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by toyg on Thursday March 24, 2022 @10:44AM (#30790573)
> while web tech was a terrible stack it was at least stable.

No no no. Web tech was/is terrible, but it's dirt cheap. You can hire JS hacks by the boatload, and retrofit whatever they build into an electron app relatively easily. Whereas desktop developers are few and expensive, and they tend to optimise for this or that platform or toolkit.

Electron didn't win on quality or features - it won on the back of commercial realities of the development world.

Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by KptMarchewa on Thursday March 24, 2022 @10:47AM (#30790628)
I don't think 'desktop' devs are any more expensive or cheaper. There's definitely way less of them and majority of people who know stuff like Win32 APIs are either very specialized or working on games.
Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by toyg on Thursday March 24, 2022 @09:12PM (#30797650)
Basic supply and demand dictates than, being fewer, they would command higher prices. Which they did, until JS ate the world.
Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by numpad0 on Thursday March 24, 2022 @11:40AM (#30791428)
Can’t set up a sweatshop as a school and have students pay to work on Win32 apps.
Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by KptMarchewa on Friday March 25, 2022 @06:44AM (#30800524)
That's what a lot of companies did 10-15 years ago in Poland. Sometimes it was Delphi. Of course, the applications were shitty, but also a lot of web is shitty.
Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by quatrevingts on Thursday March 24, 2022 @12:12PM (#30791890)
As a layout and rendering toolkit, the modern web browser is just head and shoulders above everything else in terms of features and ease of use.

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.

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.

Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by kizer on Thursday March 24, 2022 @10:52AM (#30790696)
Well, there are a number of “selling points” to electron/NW.JS or similar: reuse JS code/skills/libraries (npm) to build desktop apps; use Node.JS to build desktop apps; cross-platform. It clearly lowered the barrier and from a company’s perspective front-end talent’s “reach” is expanded.

Even way before they came out I wondered why more native apps didn’t just reuse HTML/CSS at least (many did).

Of course we all know of the downsides of Electron (basically Chromium + An App in every app; ridiculously heavy-weight.

I’m fond of the webview project and Tauri, being built on top of it. It reuses the available system browser view and doesn’t bundle Node, so it’s very light.

Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by Octoth0rpe on Thursday March 24, 2022 @03:17PM (#30794201)
> It reuses the available system browser view and doesn’t bundle Node, so it’s very light.

It's 'light' in terms of download size, it's not far off from Electron in terms of resource usage. Most complaints about Electron are about resource usage, not really download size (though there are some).

Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by kizer on Thursday March 24, 2022 @08:14PM (#30797256)
Very good point.
Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by floucky on Thursday March 24, 2022 @10:28AM (#30790288)
Javascript is going to the desktop with Electron, C# is going to the browser with Razor, what a time to be alive.
Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by EMM_386 on Thursday March 24, 2022 @11:54AM (#30791636)
> C# is going to the browser with Razor

"Blazor", actually.

Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by nobleach on Thursday March 24, 2022 @02:16PM (#30793511)
Yes. Blade + Razor.
Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by beamatronic on Thursday March 24, 2022 @10:34AM (#30790372)
I think what we need is a very thin layer, or perhaps just a binding, between JavaScript, and native UI API calls. Then you could have a JavaScript non-web app with native look and feel
Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by inamiyar on Thursday March 24, 2022 @10:43AM (#30790552)
I'm not sure if I'm reading this right but either duktape or WebView might do what you want.

https://duktape.org/ https://github.com/webview/webview

Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by beamatronic on Thursday March 24, 2022 @02:55PM (#30793961)
I'm thinking of a world with Javascript, but without HTML or a web server.
Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by cxr on Thursday March 24, 2022 @05:13PM (#30795405)
You're describing the Mozilla platform's old XUL strategy, or the modern Gnome desktop. JS has permeated GTK for the last 10 years. It was a huge part of Gnome 3. For a brief moment, pushing people to start with JS for their next GTK app was an explicit strategy for the Gnome project. There was so much backlash, though, that they backed away from that position a month or two later. Had they had the courage to stand their ground, the rise of Electron might never have happened. A world with a better GTK as the go-to cross-platform UI toolkit would have been a lot better than where we ended up instead.
Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by kaba0 on Friday March 25, 2022 @07:46AM (#30800932)
Or Qt’s QML.
Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by cxr on Friday March 25, 2022 @07:59AM (#30801047)
You can make a hello-world app with JS and GTK by creating a file hello.js, typing some code in, and then running it. AFAIK, although Qt has some support for JS integration, the story is not the same. You still need to develop a traditional Qt app and then start peppering in JS where it suits you. Am I wrong?
Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by rhengles on Saturday March 26, 2022 @10:24AM (#30812051)
I did a little proof-of-concept a long time ago using Mozilla Rhino + SWT apis and managed to get a small window on the screen with a few buttons with only javascript, but I couldn't figure out the api to make a simple http call...
Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by blablabla123 on Thursday March 24, 2022 @10:23AM (#30790184)
That's true on the other hand the state of Java desktop UI frameworks is at best confusing. I guess it's possible to write well performing Java desktop apps and yet I have a Java app that slows down my whole system and usually crashes on macOS
Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by johntdaly on Thursday March 24, 2022 @10:38AM (#30790460)
Is the App an old POS? I see a lot of old Java Apps still around that sort of bitrotted to hell. We bitched so much about Java Apps that so many just got abandoned, even if the apps where sort of cool and/or didn’t have a replacement.

Maybe I’m getting old but I’m a bit sad for all the open source apps that where abandoned over the years because the tech stack stopped being cool.

Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by kaba0 on Friday March 25, 2022 @07:48AM (#30800947)
Anecdotal, but Java is the only platform where I could download a random jar from a possibly long dead professor’s abandoned website and have a working GUI of some CS algorithm visualization with a double-click.

Hell, websites don’t hold up as well to time with all the missing links/resources.

Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by thfuran on Thursday March 24, 2022 @10:09PM (#30797959)
It's much easier to write an application that crashes in C++ than in Java. I don't think the existence of whatever program you're talking about demonstrates much.
Re:Ask HN: Does Java need a modern Java UI toolkit for deskt... by mixmastamyk on Thursday March 24, 2022 @10:37AM (#30790437)
I use DBeaver on MacOS and it is pretty good and responsive. Only one intermittent keybinding bug with home/end.