Kamahire
Kamahire

Reputation: 2209

Convert Java Swing to web-based Application

I have Java swing application. I want to convert to web base application. What is easiest way? Is there any tool available, preferably open source code?

Upvotes: 27

Views: 55527

Answers (9)

Bharat D Bhadresha
Bharat D Bhadresha

Reputation: 779

For the current visitors, Jetbrains has a new open source projector called Projector which can be used to render swing applications in web and they are using this to render their Intellij IDE also.

Below is the excerpt from their github

Projector is a way to run Swing applications without any windowing system and accessing them either locally or remotely.

JetBrains Projector

This project is still in incubator stage. But I have tried using it with their IDE and its working great.

Upvotes: 1

balalopilav
balalopilav

Reputation: 56

I know this is late but Webswing lets you run Java Swing applictions in your webbrowser.

Upvotes: 1

Alok Arora
Alok Arora

Reputation: 176

AjaxSwing is a run-time tool and needs a server license for commercial use.

You might want to try Mia Transformer -parts of the website are in French-. They change Swing Java code to GWT Java Code and GWT changes it to Javascript and then if you want you can use Google V8 compiler for faster execution. Of course it is not 100%. We are going to try it for a large project and see if it works.

The other link provided to us was SwingWeb. Have not checked it out though.

Will keep you posted. If you come across a workable solution please share.

Upvotes: 14

eeq
eeq

Reputation: 2118

For a Java programmer the Vaadin framework is very similar to Java Swing.

Architecturally, Vaadin and Swing applications are of course quite different (web vs desktop), but because the UI logic in Vaadin applications is run on the server side (in a JVM), all the Java classes and application logic from Swing applications is typically fully reusable. You can see in the hello-world sample how similar the event-diven programming model is to Swing.

Furthermore, Vaadin effectively hides all the web specific details (html, css, rpc,...) from Java application programmers, making it a familiar and effective tool to convert old Swing applications to modern HTML5 web applications.

Upvotes: 12

Angel O'Sphere
Angel O'Sphere

Reputation: 2666

This tool: http://sourceforge.net/projects/j-wings/ is a API compatible replacement for Swing but runs in an servlet engine renders to HTML.

Upvotes: 1

webswingauthor
webswingauthor

Reputation: 229

There is a new open source project webswing.org. It is a web server where you deploy your swing application. The application is rendered to html canvas through websockets, so you get the exact same look and feel like on desktop.

Upvotes: 22

jzd
jzd

Reputation: 23629

As Vinod mentioned Java Web Start is the easiest way. Another alternative is to convert the application to an Applet that you can run from a web page.

Upvotes: -1

vinod
vinod

Reputation: 1202

You can think about Java Web Start it's not converting the application but you can use your application as web based...

Upvotes: 5

Suraj Chandran
Suraj Chandran

Reputation: 24791

There is actually a magic tool you could use to convert desktop apps to web apps: AjaxSwing

But note that it can only convert very simple swing apps. If you use complex renderers, you may not get right results. Also its not free.

Upvotes: 7

Related Questions