Question

I saw some other similar questions on this topic here but they were not very helpful so I a posing this question.

What is the fastest way to convert a reasonably sized, simple web app to a Java desk top based client targeted for pc and mac? Unfortunately I can not share a whole lot of details about the app here due to various reasons. The most complicated UI in the app though is a page that contains a multi level threaded discussions (please see here for an illustrative example of what I am talking about.) The current web app is based on python so I can not re use anything from the server side code (dont think this is an issue)

I have never done any swing or awt or any other Java based thick client GUI work. My thinking is more or less defined by web based applications. I am capable of doing end to end web app development (including backend and decent UI using HTML, CSS and JS) using Java or python. For your answers please focus on Java solutions only.

So here are my questions What is the best framework or tool I should use? I found some of the following tools on the web as part of my research.

  1. Awt - does not look like this is a good choice.
  2. Swing which I believe is bundled with regular Java SDK/JRE. - This may be my best bet.
  3. SWT which seems to compliment Swing in some fashion.
  4. Griffon based on an article here. This framework uses Groovy ( I have no clue about Groovy, btw) Adobe Air flex. Any open source frameworks?

What are some of the other issues that I need to keep in mind? Some that I would like your comments on are:

  1. How does the fact that it needs to be deployed on the client complicates things? Since we are using Java, I believe this to be a non issue. I am aware of the usual trade offs between a web based app and a desktop app (e.g. ease of deployment and upgrades etc etc.)
  2. How easy is it to create a one click installer and bundle the app and the environment needed - eg. JRE etc?
  3. The product needs to work on Mac and Windows. Does that complicate things in any way (Again, since it is Java I am assuming there are no gotchas but would like to be forewarned if there are any)
  4. What is the framework or technology that may be good to have on the resume as a skill set?

My deadline is a max of 2 months - would that be enough for a reasonably simple web app given that I need to learn all of these technologies? I am just trying to get a sense here - I know it is most likely impossible to give an accurate answer - just assume I am smart enough and can pick up any unfamiliar tech stack fast enough.

Thank you!

Was it helpful?

Solution

GUI toolkit

Given "Mac and Windows", I'd say that settles my recommendation as "Swing" (perhaps with SwingX1).

  1. I agree with your assessment of AWT. It does not support formatted text in any component out-of-the-box. It also lacks trees, tables (and other components) & people with recent experience using it. Note though, that it is also "bundled with regular Java SDK/JRE" just like Swing, it is just that it is older and less enabled than Swing generally.
  2. If anything complements Swing it would be SwingX. SwingX is built on Swing and provides advanced controls that are not available 'out of the box' in the J2SE.
  3. Swing and SWT are mutually incompatible - use one or the other.
  4. I have no experience with Griffon.

Swing is the most used of the options outlined, so for getting help (ignoring other potentially important factors in the decision), it would be a good choice.

Note 1) Add SwingX if they have any groovy components that present threaded conversations easily, but I suspect a JTextPane would suffice.


Deployment

As far as deployment goes, that is a little more tricky than it seems. Many desktop computers do not come with Java as standard. Those that already have it, might have an old version.

  1. To ensure a JRE of the right minimum version to run the app. is available, use the deployJava.js (mentioned, with links, in the JWS page below).
  2. To provide a 'one click' launch experience for the user, look to Java Web Start.

Cross-platform gotcha's

Unfortunately, though Java is x-plat, there are plenty of things that programmers can do that stuff that up. E.G.

  • Not accounting for the platform default:
    • File encoding (file.encoding2)
    • Line break (line.separator2)
    • File separator (file.separator2)
  • Coding fixed size ('absolute layout') apps. that will be shown as different sized apps. on other OS.
  • ...

Note 2. That is showing the property to use for each.


Timetable

Obviously I cannot speak for you, but I can tell you that I would have had no chance of going from 'which technology' to a 'deployable app' within two months.

Hope you're more capable than me! ;)

OTHER TIPS

You can try doing so in small steps: * As a first step you can create an applications with SWT and embed your application in a browser control. * Then you should move pages and some controls from the web app to the desktop one by one.

In this way you can get a minimal application in hours :)

P.S. If you want an iOS app with this approach it's worth looking at this open source project: http://en.wikipedia.org/wiki/PhoneGap

You said that you wanted a Java solution, but be aware that there are plenty of Gui options in Python, and you already have your web application written in Python.

Groovy is a different programming language than Java, but Groovy runs on the JVM. Do you want a Java solution or a JVM solution? I ask because you mention Griffon.

Assuming you want Java, I think your main options are Swing, SWT, JavaFX 2, and Apache Pivot. Oracle has said that they intend for JavaFX to replace Swing as the GUI platform of choice. That said, JavaFX 2 is in its infancy, and only a preview release is available for Mac right now. The upshot of JavaFX and Apache Pivot is that you could use the same code for your web application as your desktop application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top