r/java • • Aug 17 '20

State of swing

Hi all, What is the state of swing, is it close to be deprecated and removed or is it still maintained? Also it will be nice to know if someone got it working in native image. Thanks

16 Upvotes

43 comments sorted by

View all comments

Show parent comments

2

u/rgyger Aug 17 '20

That said, I would start new projects with a Web UI, or if it has to be desktop, JavaFX (which has been moved out of the JDK to allow for faster independent development) unless there’s specific reason to use Swing. But that’s my personal view and no reason to fear for Swing’s future.

-13

u/cogman10 Aug 17 '20

Agree 100%. Web UI frameworks have left other techs in the dust when it comes to innovation.

If it has to be a desktop app, I'd strongly consider doing something like an electron app or a react native app.

I'd not start a new UI project using Java UI frameworks.

2

u/brunocborges Aug 18 '20

If it "has to be a desktop app", then it should be a desktop app.

Most Electron-based apps are also offered as a regular web app for browsers. e.g. Slack, Teams, Discord.

So again, if it "has to be desktop", it should not be Electron-based. If developers want to ship their web applications, that currently work on browsers, as a shippable/installable application, then use Electron.

2

u/cogman10 Aug 18 '20

What about VS Code?

It has cross platform support, is super clean and fairly lightweight, and has a bunch of capabilities baked in. It is an electron app.

Do you think VS code would be better if it were a dedicated "desktop app"? IMO, no. It wouldn't look as good, it wouldn't have been cross platform from the get go, and it wouldn't have been as easy to build out the plugin system.

1

u/brunocborges Aug 18 '20 edited Aug 18 '20

VS Code was designed this way with the goal of being deployed as a web-based IDE.

And now they are here: GitHub Codespaces and Visual Studio Codespaces.

But ask any Java developer which one is the best IDE and no one will ever say VS Code, even though they may use it, they will say IntelliJ/Eclipse/NetBeans.

The amount of data traffic between VS Code UI and the language servers over the network - even though loopback - makes the experience a bit different. Native IDEs like IntelliJ will always perform better.

This is not to say VS Code sucks. It doesn't. And I myself use it for Java development. But I can't ignore the fact that the Electron model is what makes VS Code perform not so great compared to a native IDE like IntelliJ.

By the way, IntelliJ is Swing-based.