Java To C# Converter is a useless tool

V

Vitaly Shelest

Hi,
my company has started a migration of applets to C#. The only tool available
in MS VS7 is JLAC. I tried to convert an applet (202 java source files,
about 2.6 MB) to C# with JLAC and I faced with problems
- from IDE this tool throws exception: "Stack Overflow";
- after using JConverter.exe from DOS Prompt I managed to get my code
converted to C#. The problem is that JLAC makes a plane substitution of
class types and in the result I had got about 7500 errors (because
incompatibility of JAVA and C# classes), which I should fix manually. But
complexity of such job is compatible with developing a new (C#) project
without any conversion.
From my point of view the tools like JLAC should substitute JAVA classes
with wrappers that support AWT (maybe SWING for SUN JAVA to C# converters)
functionality. Some month ago I made a migration of MS JAVA Applet to SWING
API. For this I wrote some tool. It substitutes AWT classes with SWING
classes. Doing this work I have faced with the same problem: in many cases
the plane class substitution is not acceptable. For example, functionalities
of java.awt.PopupMenu and javax.swing.JPopupMenu are different and the
substitution is not possible. For this my converter uses a wrapper:
package my.swing;
import java.awt.Component;
import javax.swing.Action;
import javax.swing.JMenu;

public class JPopupMenu extends JMenu {

public JPopupMenu() {
super();
}

public JPopupMenu(String s) {
super(s);
}

public JPopupMenu(String s, boolean b) {
super(s, b);
}

public JPopupMenu(Action a) {
super(a);
}

public void show(Component origin, int x, int y) {
javax.swing.JPopupMenu pum = getPopupMenu();
pum.setLightWeightPopupEnabled(false);
pum.show(origin, x, y);
}
}


I guess the same should be done while developing JLAC.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top