views:

194

answers:

5

I'm about to write a small desktop app that should run on Windows and Mac OS X mainly. The choices I have so far are:

  • I usually use Java + Swing for this type of stuff, but this app should be really tiny (about 1Mb) and I don't want to embed the ~26mb JRE on the Windows version or ask users to have it installed.
  • I have good experience with Flex and AIR and users of this app will eventually use the Flash player (the app will output swf files most of the time). But performance is important (kinda), and I would like to write an app that have native look-and-feel.
  • I've been also considering realBasic. It seems promising and easy to get started with. But, I really do not want to write basic. It's been a very long time since I wrote basic programs (about 10 years). Plus, I can't find many supporters of it.

I don't have any working experience in C/C++. And this is a very small project that I would like to finish in about a month. Any suggestions?

A: 

Is the JRE really that rare among your Windows based target users? I'm fairly sure most manufactures now ship a recent version of Java on their machines. If it rare then using SWT and compiling to native might be an option¹.

¹ - SWT as (as I understand it) compiling the Swing stuff to native basically means you need the whole JRE. My failing memory tells me that this is due to some odd licence requirements.

mlk
SWT doesnt involve compiling AFAIK - SWT is another widgeting library that uses the native OS calls to draw the widgets (unlike swing, which uses a drawing api like awt which just emulates native widgets look-and-feel). Its faster as a result, and look more native.
Chii
I mean compiling the application to native to avoid including the JRE. The reason I am suggesting using SWT is (last I checked) that if you compile to native but include Swing then you have to also include the complete JRE (which is what we want to avoid). If we leave Swing out then we can only include the bits of the JRE the application actually requires. Using SWT also allows you to use to use GCJ.
mlk
http://www.javalobby.org/java/forums/t19231.html#91837038Reply nine - *The problem is that the Sun JRE license does not permit partial redsitribution, so you have to include it with your compiled app, even though most of it will not be used. *
mlk
Would the down-rater mind explaining why? Compiling Java-to-native to reduce file size overhead seams like a good option to me.
mlk
There are just griefers around on the internet no matter what - this is a valid suggestion, please dont be dismay-ed at the downvote. I dont think this answer deserved a downvote.
Chii
SWT is the Eclipse GUI library for rich clients.
Thorbjørn Ravn Andersen
Thorbjørn would you mind expanding on your comment.
mlk
A: 

How well would a web-app work for you? These days, the GUI capabilities of the browser is good enough for most things (provided the browser is not IE) other than high definition real time graphics like games. things like http://labs.mozilla.com/prism/ might fit the bill?

Chii
I'm afraid users will hesitate to upload the files they will be working on online. But I'm still considering this options. If I went with Flex/AIR i will probably provide an online (in-browser) version as well.
Ammar
you mis-understood me when i say web-app: a web app doesnt need to be hosted on a remote server - it could be a local server, running on a client machine. The GUI is html based, and the user access it through a browser.
Chii
This is not how prism works.
Ammar
+4  A: 

I would say stick with Java + Swing, unlike contrary belief you can have great looking programs using swing. You need to put in some effort to set some properties and make sure where you create files depending on the os your on but it is much less work then say C++ or C. Even if you do nothing you application will look the same and work on all major os's (Linux,Windows,Mac Os X).

For some reference check out mac-widgets these are no different from the os x supplied counterparts. The guy also has a blog where he explains how he did it. In java your can override anything to shape it into the way you want it to look.

As for JRE install os x comes pre installed with java no problem there for Windows you can use a exe wrapper and it checks the correct JRE and installs it for you, but as it's already pointed out most computer have java pre installed.

Hamza Yerlikaya
+1 for mac-widgets.
Thorbjørn Ravn Andersen
+1  A: 

If you want a single code base running easily on both Windows and OS X you basically have two choices:

  • Java
  • a Web Application.

I have good experiences with the Java path. Programs run reasonably well, and you have much power in the Swing GUI (but it takes some getting used to). If you use Java Web Start for launching you have control on the deployment, users are easily prompted to download the JRE (the latest version is a much smaller download), and you can either go for the Nimbus look and feel (which I think is really nice) or a platform specific look and feel with a single line in your main method.

The only downside as I see it, is the JRE download. I would accept that and get on with the project :) You will not get anything better without a LOT of elbow grease.

Thorbjørn Ravn Andersen
Those aren't the only choices IMO. Several scripting languages work cross-platform. With Tcl/Tk for example, you can write your application in Tcl, the combine it with a platform-specific runtime to create a single file executable for each target platform.
Bryan Oakley
+5  A: 

REALbasic can be a great way to create cross-platform apps. The language is fully object-oriented and resembles Java far more than it does any version of BASIC that you may have used.

REALbasic does compile to native apps with a native look-and-feel, but the executables are not small. Even an empty app will be more than 1MB.

However, given your app will output Flash files, it seems like Flex/AIR might make the most sense for this project.

Paul Lefebvre