Java Swing to web migration: pick the right path

Your Swing app still works. Users depend on it, the business rules inside it took years to get right, and now someone wants it in the browser. That is where a Java Swing to web migration starts, and most answers you find online begin with a new JavaScript front end.
To migrate a Java Swing app to web, you have three real paths and one combination: rewrite the UI in JavaScript against a new REST API, run the existing app in the browser with Webswing, or rebuild the UI screen by screen in Java with webforJ, the full-stack Java framework. For many Java teams the best long-term target is webforJ, because your developers stay in Java and your business logic carries over. The fastest route to a first browser release is often both together, Webswing first and webforJ second.
The webforj-crud app shows the kind of screen most Swing teams migrate first: a table, a search field and a form dialog with validation for adding, editing, and deleting entries. It is a Spring Boot app that runs with Java and Maven.
Moving a desktop Java app to the web?
Send us a screenshot of one screen and we'll reply with how it moves to webforJ.
The paths a team really has
Every Swing to web migration plan falls into one of these four shapes. The first three are the pure options, the fourth combines two of them.
- Rewrite with a JavaScript front end and a REST API. You expose the business logic as services and build a new UI in a JavaScript framework.
- Run the Swing app in the browser as-is. A server runs the desktop app and streams it to the browser. No UI code changes.
- Rebuild the UI in Java with webforJ. You move one screen at a time into a Java web app and keep your domain code.
- Combine 2 and 3. Users get the browser version now, and you replace screens behind the scenes.
The rest of this guide compares them on the things that decide a project: how much code you rewrite, which skills the team needs, how long users wait, and where you end up.
Path 1: rewrite with JavaScript and REST
This is the path most search results describe. You put an API in front of your services, then build every screen again in a different language, with a different component model, a different build tool and a different way of handling state.
It can work when you already have a front-end team and a clean service layer. For a Java team it means two stacks, two sets of skills and often a long stretch where nothing reaches users. The Swing screens carry hidden behavior in listeners, validation and enabled-state logic. A rewrite has to rediscover all of it, and a JSON API turns every one of those small interactions into a contract you must design and keep stable.
Choose it only if your organization has already decided on a JavaScript front end for other reasons.