Hacker News new | ask | show | jobs
by bluejekyll 2395 days ago
Would that Java application be capable of running in the browser? JavaFX, maybe?
1 comments

That "Hello World" example uses Java's Swing GUI framework which is older and does not port to the web as easily as JavaFX.

Here is the JavaFX-based "Hello World":

https://docs.oracle.com/javafx/2/get_started/hello_world.htm...

There are also numerous Java to Web frameworks and solutions like TeaVM (https://blogs.oracle.com/javamagazine/java-in-the-browser-wi...), JSF (https://javaee.github.io/javaserverfaces-spec/), and many others, but at that point you are no longer talking about just a cross-platform GUI--you are talking about a web application.

Isn’t that generally the main benefit of using electron based apps? The ability to target both desktop and web?

We can bemoan the inefficiency of this, and how wasteful it is, but at the end of the day, it’s a very portable way of delivering applications.

I think VSCode is a huge success because of this model.

>> Isn’t that generally the main benefit of using electron based apps? The ability to target both desktop and web?

Yes, but then what would be the point of ElectronCGI?

If the goal is to target desktop and web then Electron is a great choice. There are many popular Electron-based applications that show this, e.g. Slack, VSCode, etc.

ElectronCGI is supposed to provide a cross-platform GUI for use cases where the full Electron stack is not wanted or perhaps not available.

I applaud the effort, but it strikes me as a strange choice since it brings the client-server and async complexities from web programming into a desktop environment. It seems like a very niche use case. Perhaps if you have a large .NET codebase that needs to be available as a cross-platform desktop application, but for some reason you can't use Electron / Blazor ?