views:

512

answers:

8

I have seen a lot of people try to make a web ui looks like a desktop ui. However, most of the time i feel web ui is much more interesting than the desktop ui, with the help of javascript toolkit like jquery, gwt-ext etc.

My question is, how to port the web ui to desktop ui? Do I need to embed a javascript engine in java? css engine? html layout engine? That sounds like a lot of work to do.

Any easy way of doing this?

A: 

It not 'a lot of work to do', it's a huge amount of work to do - you would in effect be writing you own browser and it'd never come close to the poplar ones out there, simply because you wouldn't get the level of feedback something like Firefox gets.

If you're trying to avoid address bars, menu bars, etc these can be switched off in all the popular browsers and so to the user the appearance would be that it's more application like with only the rich content of the HTML visible.

Nick Holt
+3  A: 

Adobe AIR technology solves this exact problem. The code you develop using Flex can be rendered in the Flash player plugin of a browser or the same code can be easily packaged as a Desktop application that runs on the AIR runtime.

TorVic
thats a flash app, not a web app.
aepurniet
Not just Flex - you can make HTML/JavaScript only run as an AIR application too. However, you can't do this with JSPs - because they have to get interpreted on the server to generate the HTML pages. You could do this with static HTML with JavaScript that made calls back to the server however. I've heard GWT can work with AIR - possibly something like Echo2, also.
Nate
A: 

Sounds like JavaFX would be good for you?

http://en.wikipedia.org/wiki/Javafx

Steve Claridge
+2  A: 

you can embed a web server in your app and you can embed a browser inside your app window. i know eclipse does this pretty well. it uses SWT to do the heavy lifting

http://www.eclipse.org/swt/snippets/#browser
check the Browser section

your web server doesnt even have to be a proper web server, it just has to set the content, and can query / change it on the fly. the javascript on the page can even interact directly with your app.

you should be even able to use crazy web frameworks like

http://echo.nextapp.com/site/
or
http://code.google.com/webtoolkit/

or even run a ruby site through JRUBY
or make really complex apps using the new HTML5 engine [canvas/video tags] (if your client has the new mozilla installed)

aepurniet
+1  A: 

Have you seen Appcelerator's Titanium Desktop
This is one of the best solution for you (i think!)
You write the javascript and html code, and the titanium SDK creates the Desktop application of the same
There is support for Python and Ruby.
Must try :
http://www.appcelerator.com/products/titanium-desktop/
if you are a Ruby programmer then you must also see this
http://www.rubyinside.com/bowline-rails-for-the-desktop-2183.html

Webbisshh
A: 

Try XULRunner from Mozilla. If you have developed extensions for Firefox, then this is the exact same thing. XULRunner contains the Gecko engine, so it can render XUL and HTML with CSS, and it supports JavaScript with many useful XUL Components, like file read and write, directory browser and network tools.

Because it supports HTML you can in effect make a webpage and have it run like an application. Also it is cross platform, so it will run on Windows, Mac and Linux, anywhere Firefox runs actually.

There is some information on creating XULRunner applications on the net, but since it's so similar to making Firefox Extensions, you can just google for that. A good Tutorial for getting started is this one.

Marius
A: 

Prism from Mozilla is made for this goal, exactly. It's out of beta now too, I believe.

Wahnfrieden
+1  A: 

Check Google Gears y Adobe AIR

JuanZe