Home >
I needed to estimate the effort required to port a Spring Rich Client application to AIR. Spring RCP applications are actually Java Swing applications. The project had 93 Java files, consisting of 118 Java classes and 16,950 total lines of Java code.
I thought it would be helpful to begin by converting Java syntax to ActionScript syntax, then change the parts that don't make sense in ActionScript. The Java Swing application I needed to port had many similarities to the structure of a Flex application.
I looked around and found two Java to ActionScript converters:
- J2AS was written as an Eclipse plug-in, but has not been maintained.
- J2AS3 was first written as a Flex program, then moved to AIR. It seemed like a better way to go for my needs.
You can download J2AS3 from http://code.google.com/p/j2as3. Although I improved the program, it is still fairly raw. Interested in improving the converter? Go for it!
_______________________________
Mike Slinn
Independent full-service software contractor and author
http://slinnbooks.com
http://mslinn.com




Facebook Application Development
You did not tell us what was your effort estimation. Did you successfully convert all that Java code to ActionScript? Does it really work, Mike?
I have a Swing app written 2.5 years ago which actually does what an AIR app should do - a file browser & files modifications + local DB + uploads to multiple web sites. I wold love to know if it can be a real deal porting it to AIR.
From the other hand, I definitely do not want to lose the richness and openness of the Java source code world. So many things exist as free open source libraries!
Does all that Alchemy magic really works now? Can I right away communicate with a C library from AIR app or it is still under development? Can I communicate with a Java code, e.g. call some functions from a jar? What is XML and/or XML PRC support in AIR?
Is there any good repository of open source AIR projects?
Yes, this really works. Remember, this is a syntactic conversion only. There is no magic. Here is some additional information: http://www.mslinn.com/blog/?tag=flex-air
ActionScript clients can do everything you describe. XML support in particular is excellent, because of E4X. Many open source Flex projects exist; I am involved with several.
Flex applications run inside a sandbox, and Adobe in their wisdom has chosen not to allow Flex to be linkable with other languages. This is perhaps the single most requested feature for Flex, but decision makers at Adobe do not seem to understand how many potential use cases are negatively impacted by this decision.
Sounds like you are just getting started with Flex. Porting code from one programming environment to another is an advanced topic, and should only be done by someone who is expert with both Java and ActionScript. I was brought into this project because the client did not have in-house capability.
Interesting post.
Why did you move away from Spring Rich Client?
Regards,
Peter.
Hi mike,
You said J2AS3 converts java to ActionScript3 only the syntax, how to convert methods which are not there in Action Script. Is there any way to convert an applet into Actionscript3.
Thanks for the great article indeed. I am highly interested in java application development so this Converter will be very useful for me. I have never used Java to ActionScript Converter before, so thanks for reviewing it in your blog. Detailed and specified reviews really helps in choosing one or other product. Thanks one more time for this entry, I will be looking forward to other nice posts from you in the nearest future.
Sincerely,
James Lighton from jpg converter