views:

362

answers:

4

Hello

I am used to develop web applications in Java (Struts, Spring, JSP...). But now I want to develop a desktop one. I never liked to design windows in Java (AWT, Swing, SWT): too much work for an ugly interface. So I think it could be a good idea if could take advantage of my web-app skills. One option is to modify the SWT Browser and make calls to a Java function instead of HTTP requests. A very good add-on would be use of JSP. Finally, I thought that probably there is some framework or tool for this.

Do you think that what I propose is a good idea? There is available some framework for this?

I need this for light applications. So I think that embedding an Tomcat server and using it with HTTP requests is not a good idea.

Thanks for your help.

Edit: One example application could be a folder comparer: you specify two folders and the app shows you wich folders and files are different. In this case, I think opening an external browser is ugly. Bloated application (with its server, MVC, etc) wouldn't be the best choice.

+1  A: 

There are several options: You can use the plugin API of Firefox and develop your app in there. You can use HTML, JavaScript, the built-in database, all the browser features and access the OS level.

Or you could try PyQt (Python and Qt) which allows to write simple applications very quickly.

[EDIT] The main problem you're facing is security: For security reasons, JavaScript apps (running in a HTML page) can't access local OS resources. So unless your browser allows you to write plugins in JavaScript (which is only true for FF AFAIK), there is no way to write an application which uses HTML as the "view" without the help of something else.

Moreover, HTML is very limited when it comes to features for applications. HTML is designed to be a "static document view" not an "application". You can do things like GMail but if you compare GMail to any real mail app (Outlook, Thunderbird, Notes), you'll see quickly that real desktop apps offer a lot more features.

Aaron Digulla
Thanks for your answer, but I think this is not exactly what I'm looking for. I want to make an idependent application, and it wouldn't be necessary to install Firefox or any other application (except Java). PyQt can be a good way of doing desktop applications, but Python is not Java and Qt is not HTML. In fact, Qt is more like Swing, etc. Greetings.
Sinuhe
See my edits: What you want is probably impossible if you insist on all your points.
Aaron Digulla
A: 

I wouldn't discount embedding a web server. I've done this before with a web start application embedding Jetty.

The download was pretty fast, the server starts up and you can use BrowserLauncher to immediately drive your browser to the embedded server, and hence your application. Jetty is designed to be modular and have a small footprint, so you can probably cut it down to the bare necessities.

Brian Agnew
Embedding a light server as Jetty is not completely ruled out. Maybe is what I will do is I don't find something like I asked for.Thanks.
Sinuhe
+2  A: 

If you have used the JavaScript library - ExtJs - then you can use it with Adobe AIR to build good looking desktop based web app.

Building app's in Adobe AIR is also simple and elegant with the flex builder ide.

techzen
I love ExtJS ;) As commented before, the problem is that AIR is not for Java programming and you won't get an executable file: the user must install AIR. Correct me if I'm wrong, please. And thanks!
Sinuhe
You must try Aptana with it. They have great set of examples to get you going.
Alec Smart
You can use merapi API (code in java) and then front-end with AIR. Bundle the app and installer in one set.
techzen
+2  A: 

If your option goes to embed a light server, check winstone is not fully J2EE compliant but should be enough for what you need. About the browser, I am not a big fan of swt myself, it complicates a lot cross-platform deployment, so probably worth to keep an eye on jwebpane, not quite ready yet, but probably the solution you'll need.

pedromarce