views:

218

answers:

4

I am reviewing currently a medium size code base (around 30K LOC) which uses a huge Applet and interfaces with other systems.

It's a tool to create custom labels, so we need drag-n-drop and other related UI components.

To which technogly will you migrate given the code base is in Java.

  • Applet -- No
  • Java FX -- Adoption rate is too low
  • GWT -- Refactoring is not easy

Any ideas/suggestions.

+5  A: 

Why do you need to migrate this ? Because of drag-n-drop ?

Perhaps you should look at running it as a stand-alone Java application and use Java Web Start to serve it up. I think the coding changes should be minimal to convert it from an applet.

Brian Agnew
You can write a JNLP file that runs an applet unchanged in WebStart (although it doesn't get LiveConnect, obviously).
Tom Hawtin - tackline
I didn't realise that. Thx, Tom
Brian Agnew
Agreed - sounds like a good soln. JNLP and web start works suprisingly well.
Joel
Thanks for the info. The applet size has become huge and it takes a while even in good network. So we wanted to break and were thinking time to refactor or wrap it.
lud0h
The application has a normal Web application part from there the users can go into design mode and come back and use them in their choices. So cannot run as a stand-alone.
lud0h
You could try the pack200 format and make sure that you configure the caching parameters of the applet as well. The defaults are broken in many versions of the JRE/Plugin.
David Nouls
Another solution is to split up the applet using a custom classloader for example. The default classloader tries to load classes from the website before actually trying from the jar files.
David Nouls
A: 

I will suggest you GWT coupled with a good UI library (for ex. Ext-GWT, aka GXT). I think that with a good UI library migration is not so difficult. Bye Claudio

Claudio
+1  A: 

Your question is a bit hard to understand. As far as I know JavaFX and Applets share the same technology.

I use GWT frequently and I believe it is quite easy to migrate from Applets/Swing to GWT. But you can only use a subset of the java libraries, so don't expect that you can just compile a SWING app and run it with GWT. Some things are just not doable in the browser so you might need to move some of the code to the server and leave only the UI layer in the browser.

What do you mean when you say it interfaces with other systems ? If you need to connect to other machines from the applet/browser then don't forget that GWT is just JS so it has the same origin policy that would block this. There are possible workarounds for this, but that will cost you some extra work.

David Nouls
+1  A: 

Use AjaxSwing to automatically convert your applet to web application. You may have to write your own drag and drop but you'd have to do it with any other framework. At least you get the rest without doing any coding.

http://ajaxswing.com

Maximus
Cool. Do you have a first-hand feedback? Thanks.
lud0h
Yes, we've used it on a couple of applications and it worked pretty well. Not everything worked 100% out of the box so we had to do minor tweaks in Swing code for multithreading, and we had to do some config changes for a couple of custom components. But it was a quick process and in the end the whole app worked in the browser just like a real web application.
Maximus