• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Swing/Applet to HTML+JavaScript converter?

 
Ranch Hand
Posts: 507
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am duplicating this question which I did not get the needed answer.

I wrote a Swing-based desktop application (kind of a small calculator), and I've been asked to convert it to a web application. I have the applet version of this as well but Applets aren't an option. I lack the time or experience necessary to do the conversion by hand.

Is there any software that can help me convert my desktop app or applet to a web app? I cannot buy one, so free/opensource or trial versions will be good. Also, I'm not looking for a runtime converter (like AjaxSwing) - I want to statically convert the source code. Which means, I just need the converted HTML+JAVASCRIPT (or whatever which I do not have to install to run like Java plugin. and not server based) code of my Java code.

I looked at GWT as well. It seems like it requires their framework and it will take sometime to learn it, not just like clicking the "convert" button and get the converted Javascript. I have limited time left with someone who thinks Java is a "virus" and wanted this to be converted.

Please help
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no software that I know that will convert a Java Swing or Applet program to an HTML + Ajax program.

If your boss thinks that Java is a "virus", what is he planning on using for the server side of the web app? PHP? Ruby? Python?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:If your boss thinks that Java is a "virus", what is he planning on using for the server side of the web app?


I think we should be careful to differentiate between client-side Java and server-side Java from a security perspective, lest someone reads this and gets the wrong idea...
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for posting the link to the cross post. We appreciate that. (It lets us see what has been suggested already so as not to waste time suggesting the exact same thing.)

I don't think what you are looking for exists in any form - paid or free. I think that the next step should be to arrange a sit down with the person who gave you the work to go over the pros/cons.

Applets: Run in a sandbox and aren't going to do random things to a computer. And it's done already.

A web page version: Has the advantage of not requiring a Java plugin but will take time to write.

Your boss (or whomever laid out the constraint of technology change) needs to decide which of the two is more important.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:I think we should be careful to differentiate between client-side Java and server-side Java from a security perspective, lest someone reads this and gets the wrong idea...


Yes. That's why I specifically mentioned the server side. There is a big difference.
 
Ranch Hand
Posts: 334
2
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is an interesting problem. I've been sort of working on a framework as part of a servlet based project that builds a page from objects with the idea it could render it in html (which it does now) or Swing which is just a gleam in my eye. I don't have anything for you but I think I understand the problem.

If I were to make a suggestion: it might not be too much work to make an html form for your app and keep all the logic on the server side in java. How much work that will be depends a lot on how well you separated the logic from the interface in your applet/program. One of my issues with Swing is that I tend to intertwine the two way too much because it's so easy to add 2 lines of code to an event handler rather than separate things.

I do understand the reluctance to use applets. Besides the mass hysteria about security there's also the lack of universal support in browsers. Plus they can't be run on smart phones and tablets as far as I know.

Joe
 
What I don't understand is how they changed the earth's orbit to fit the metric calendar. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic