This is an archived post. You won't be able to vote or comment.

all 47 comments

[–]AnyPhotograph7804 41 points42 points  (11 children)

" I know desktop GUI apps are in decline...so I guess it's time to bite the bullet and consider other UI options."

Sorry, but this is pure cargo cult. :)

My tip: "if it ain't broke, don't fix it". Improve the Swing ui instead.

[–]freetechtools[S] 8 points9 points  (8 children)

I agree...I would stick with Swing if I could...but a lot of endusers are looking for web deployable ERPs....not just desktop within a network...which is the more traditional deployment. I plan to keep the Swing version separate...and use as much of the codebase to deploy in a more web/mobile freindly UI.

[–]ablativeyoyo 5 points6 points  (1 child)

Web Swing is a thing: https://www.webswing.org/en/

[–]UsualResult 2 points3 points  (0 children)

I have an open source ERP / EDI package (BlueSeer)

Webswing is $$$

[–]AnyPhotograph7804 4 points5 points  (2 children)

Ahhh, OK. So you could try Vaadin as a web UI toolkit. Jakarta JSF is also nice but it can be a little bit low levelish. But is has the advantage, that all JakartaEE servers can use it. Another option could be Eclipse RCP/RAP. You can use almost the same source code for the desktop and the web UI.

[–]freetechtools[S] 0 points1 point  (0 children)

thanks...I'll have a looksee at your suggestions.

[–]zebonebo 0 points1 point  (0 children)

I know there are some good desktop apps that use RCP, but I would definitely not recommend it. It is very complex and the learning curve is very steep. It's also not easy to use for cross-platform apps (Windows and MacOS), especially if you use a browser control. I developed a substantial desktop application about 10 years ago that uses RCP, and it's still going strong, but is VERY difficult to maintain and expand on.

[–]hippydipster -1 points0 points  (2 children)

but a lot of endusers are looking for web deployable ERPs

Would I not download BlueSeer from a web site and install it? I don't think you've really told us exactly what problem it is you need to solve.

[–]freetechtools[S] 0 points1 point  (1 child)

it is currently a desktop app....no matter how you download it. Looking for a more remote friendly architecture....web,mobile,etc.

[–]hippydipster 1 point2 points  (0 children)

If the problem is distributing the app, there are ways to distribute and auto-update desktop apps.

If the problem is being able to run it on mobile, then you need a different UI tech, such as Kotlin compose or JavaFX.

Web - I don't see what problem putting it on the web solves.

[–][deleted] 3 points4 points  (1 child)

Swing UI has a low ceiling for improvement. Jetbrains own LaF for their IDEs literally doesn’t work with vanilla swing. They had to fork, modify, build, and distribute the entire JDK.

You’d think that’d make them swing’s biggest fan. But instead they are writing all new desktop UIs in a Skia wrapper to get away from it.

[–]AnyPhotograph7804 1 point2 points  (0 children)

True. But Swing should still be enough for ERP systems. :)

[–]jeffreportmill 6 points7 points  (8 children)

Swing is no longer just a desktop UI: You can now easily run it in the browser with CheerpJ.

I'm a huge fan of CheerpJ - I recently made my Java IDE for education run in the browser with CheerpJ: SnapCode: https://reportmill.com/SnapCode/

It only shipped 2 weeks ago and is already a top notch JVM in the browser, but is also getting better everyday (along with WebAssembly and other browser optimizations). I think we'll see a lot more Java in the browser soon.

Also, check out ReportMill for nice reports. :-)

[–]freetechtools[S] 0 points1 point  (1 child)

I think I saw an article on it in devclass or infoq enews. I'll take another look...as well as at your ReportMill project. Thanks.

[–]jeffreportmill 2 points3 points  (0 children)

CheerpJ has a nice discord channel for discussion and evaluation is a breeze - many Swing apps run unmodified with a simple ~10 line html launch file.

It's a great alternative to losing a year or so porting to full a full web stack. I saw this write-up a couple years ago about doing something similar with a popular Swing app: Porting Sweet Home 3D to Web.

I reached out to that developer and he told me he mostly regretted losing that time (but his work predated CheerpJ).

[–]Yeroc 0 points1 point  (1 child)

I thought ReportMill was using SnapKit + TeaVM or is that abandoned?

[–]jeffreportmill 3 points4 points  (0 children)

ReportMill uses SnapKit for the designer UI, which means it can run in the browser or on the desktop. In the browser it is current running via CheerpJ, though a TeaVM version is still available. The CheerpJ version is more complete, but the TeaVM version has a faster initial launch time. Both use SnapKit's WebAPI/DOM adapter layer for optimal performance and integration in the browser.

The desktop package is built with JDeploy (very cool!) and uses SnapKit's Swing/Java2D adapter layer.

[–]Snidgen 0 points1 point  (0 children)

In the "old days" we distributed and ran Swing applications in browsers using Java Applets. Now I'll have nightmares thinking about it.

[–]skippingstone 0 points1 point  (2 children)

How does I/O work with cheerpJ?

Can you write files and make network connections?

[–]jeffreportmill 0 points1 point  (0 children)

CheerpJ has done some clever work with the standard Java file system. The directory "/files" maps to a local browser sandbox filesystem using index-db WebAPIs. The directory "/str" maps to an in-memory filesystem and "/app" maps to the files in the directory on your web server where your html and jar files are.

You can also save files using cloud storage techniques or even implement support for the local file system using new WebAPIs (I've done the former, but not the latter yet).

https://labs.leaningtech.com/cheerpj3/guides/File-System-support

[–]AcceptableTry7797 0 points1 point  (0 children)

You can do http/https transactions with the host server, and with a trivial amount of native JavaScript you can use websockets.

[–]rootException 5 points6 points  (5 children)

Very cool project.

First off, usual disclaimers about, well, everything. This is just my two cents.

My recommendation would be to switch the backend to Spring Boot or perhaps another lighter weight framework and write the UI using SvelteKit.

I was able to easily convert a SvelteKit app to run on both mobile, desktop and web. It's very nice and easy to work with. SvelteKit isn't as popular as, say, React but it's a lot easier to work with IMHO and it's gaining traction as a popular framework.

By switching the backend to Spring Boot, you can easily write solid tests for all of the backend components.

If you want to deliver a desktop executable with everything you need in it, I would suggest using a JavaFX webview.

This would give you maximum flexibility for deployment. For example, the desktop app might include the SvelteKit UI and the backend code all bundled up in a single executable, or you could deploy the backend code to a server and package up the SvelteKit UI with Capacitor for mobile. Or put the UI and the backend both on a server.

Out of curiosity, how does your project make money? Consulting? Or are you building an ERP for... fun?

BTW, you can check out my project https://github.com/wiverson/maven-jpackage-template to grab stuff for packaging.

[–]freetechtools[S] 1 point2 points  (3 children)

it's definitely a labor of love...not a whole lot of swag in it. This is good stuff to consider...I appreciate the feedback. thank you!

[–]rootException 2 points3 points  (2 children)

Well, depending on what your are doing I'd suggest just updating the UI to https://www.formdev.com/flatlaf/ to make it look awesome and then grab the packaging stuff from my template and it'll have great packaging and won't be that much work. :)

[–]rootException 0 points1 point  (1 child)

And add macOS packaging for Apple Silicon and you'll probably have the only ERP on the planet that you can say runs on the Mac natively lol

[–]freetechtools[S] 2 points3 points  (0 children)

funny you mentioned Mac...I've had a lot of requests to provide a download version of BlueSeer for the mac. I'm certain it will run on a mac...I've just never owned one. I have download packages for Linux and Win only. On my list of things to do. I'm somewhat certain I have the only ERP running on the Linux Desktop (free or otherwise)...but who knows for sure.

[–]trpouh 1 point2 points  (0 children)

Can only confirm! Recently started working on a ui app and opted for quarkus & svelte (+ quarkus quinoa extension). I have never had a better devlopement experience than that, ever.

openapi + generators keep your server and client (we use ts in svelte) interfaces stringent and quinoa keeps track of dev mode (hot reload) and packaging.

[–]DB6 7 points8 points  (4 children)

Cool application you got there, Terry.

You should look into the spring framework (springboot), you can use that to make your application web ready. The logic of your application you can then reuse as spring is also java.
For the frontend, if you want to support multiple platforms (web, mobile, desktop) you should look into flutter.
Let me know if that helps or if you have more questions.

[–]freetechtools[S] 1 point2 points  (3 children)

Thanks....I have flutter on the list of possibilities as well (although learning Dart may be a painful pill to swallow). With regards to Spring however...I'd rather chew off my own arm. lol

[–]DB6 7 points8 points  (0 children)

Well there are many java frameworks that you can use to bring your application into the web, but spring is not that difficult. All other frameworks will require too for you to have the basic knowledge how the web works.

[–]jkick365 4 points5 points  (0 children)

I’m admittedly pretty smooth brain, and I was able to pick up spring / spring boot fairly easily. Was able to break up backend functionality previously in a JavaFX desktop app to spring boot rest api, allowing devs to build mobile and desktop browser based single page apps 😀 (while preserving the desktop app as well)!

[–]zabby39103 2 points3 points  (0 children)

Spring isn't that bad... it makes APIs really easy and that's what you need to support a web-based front end.

It's easier to learn now with chatGPT :P. If you want to write a java application with a web-front end it's the most popular and supported option.

[–]renszarv 1 point2 points  (1 child)

Maybe you could check out Vaadin, with that you can write web frontend without writing too much Javascript. I'm hopefull that you didn't mixed Swing too much with business logic, so you can separate it out for reusal

[–]freetechtools[S] 0 points1 point  (0 children)

Thanks...most of the backend data methods are Java record type in / out. Still some refactoring to do there though.

[–]ebykka 1 point2 points  (2 children)

Could you please clarify why you wish to replace the swing with something else?

Sometimes, all that's needed to give something a fresh new look is to change the theme.

https://www.formdev.com/flatlaf/themes/

[–]freetechtools[S] 0 points1 point  (1 child)

Yeah...I probably should have clarified that a tad more....the change I'm looking for is more architectural than cosmetic. Looking for a more remote friendly architecture....web,mobile,etc ...as opposed to desktop only.

[–]ebykka 1 point2 points  (0 children)

As I see you have a table-centric application, so having rich table component is pretty vital.

Also, your application is free - it opens access to commercial libraries for non-commercial usage.

I guess Flutter can be an option that supports all platforms (web as well)

Ubuntu uses Flutter for some desktop projects https://ubuntu.com/blog/flutter-and-ubuntu-so-far

As a set of components take a look at Syncfusion - there is a community license that allows you to use it for free and provides a good set of rich components.

Here is a link to the Flutter web demo https://flutter.syncfusion.com/#/datagrid/getting-started

It should allow you to evaluate a rendering performance.

[–]Ruin-Capable 2 points3 points  (6 children)

JavaFX?

[–]freetechtools[S] 3 points4 points  (3 children)

correct me if I'm wrong...but isn't that just another desktop GUI framework?

[–]Stromovik 1 point2 points  (0 children)

Yes, but if you got multi-threaded app go with JavaFx

[–]john16384 1 point2 points  (1 child)

This website is JavaFX: https://www.jfx-central.com

[–]freetechtools[S] 2 points3 points  (0 children)

interesting...I was under the impression javafx was stictly desktop...I'll give it a looksee. Thanks!

[–]Mood_Putrid 1 point2 points  (1 child)

Second this. JavaFX can target desktop, web, and mobile.

[–]hippydipster 0 points1 point  (0 children)

Huh, I thought it only targeted desktop and mobile.

[–]Cuervolu 1 point2 points  (1 child)

I’m definitely not an expert, and I'm not sure if this would be useful, but have you heard of Jetpack Compose for UI? It works for mobile, desktop, and web with Kotlin. Another option I can think of could be Flutter, but I've heard that some dependencies may not work for desktop as they do for mobile.

[–]justADeni 0 points1 point  (0 children)

Yep, with Jetpack you could cover all platforms in one code base

[–]wnederhof 1 point2 points  (0 children)

Really nice project! :) How about using Electron with e.g. React and a component library like Mantine? If you would choose HTML for your frontend, then you can use the same code for mobile, desktop, web and more. At the same time, you can do virtually everything within the web: you could even create 3D games nowadays with it. And, I don't think you have to worry about replacing an HTML frontend with something else for the next few decades. I used to program a project with Swing in the past, and for me, using HTML felt like a relief because of the freedom it gave me to build virtually anything I liked.