8

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.

Edit: One example application could be a folder comparer: you specify two folders and the app shows you which 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.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
sinuhepop
  • 20,010
  • 17
  • 72
  • 107
  • Please use something like Adobe AIR. Extremely good. Extremely easy. We had very good success with it. – Alec Smart Sep 16 '09 at 15:25
  • You may also like Titanium. They allow you to run Ruby & Python also. – Alec Smart Sep 16 '09 at 15:25
  • Thanks for your answers. AFAIK, AIR and Titanium are not for Java development, so my code won't be closs-platform. Also, you don't get an executable, you must install its launchers. Please, correct me if I'm wrong. – sinuhepop Sep 16 '09 at 16:11
  • You can use Adobe AIR apps on all platforms. Not sure about Titanium. – Alec Smart Sep 17 '09 at 07:44

4 Answers4

2

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
  • 2,895
  • 2
  • 22
  • 22
  • 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! – sinuhepop Sep 16 '09 at 17:16
  • You must try Aptana with it. They have great set of examples to get you going. – Alec Smart Sep 17 '09 at 07:44
  • You can use merapi API (code in java) and then front-end with AIR. Bundle the app and installer in one set. – techzen Sep 17 '09 at 08:27
2

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
  • 5,651
  • 2
  • 27
  • 27
1

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
  • 321,842
  • 108
  • 597
  • 820
  • 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. – sinuhepop Sep 16 '09 at 15:34
  • See my edits: What you want is probably impossible if you insist on all your points. – Aaron Digulla Sep 17 '09 at 07:42
1

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
  • 268,207
  • 37
  • 334
  • 440
  • 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. – sinuhepop Sep 16 '09 at 16:27