views:

686

answers:

2

Hello i know i can write c++ back end and use xul(runner) as the front end but can i use java as back end and still use xul as front end ( executing java code ) ?

+2  A: 

You can always make an java backend which uses eg. RPC calls between the java backend and the XULrunner front end. Zimbra desktop is such and example.

Here is a small overview : http://www.zimbrablog.com/blog/archives/2009/04/zimbra-desktop-no-light-no-air.html

More info here : http://www.zimbra.com/products/desktop.html

It's free to download and the source is availible : http://wiki.zimbra.com/index.php?title=Building_Zimbra_using_Perforce#Building_Zimbra_Desktop

lithorus
Zimbra doesn't make use of XUL directly, they simply use Mozilla Prism to "desktopify" an ajax web application.
ordnungswidrig
That's true. But when/if you want to use another language as backend it doesn't have to make much difference.
lithorus
+4  A: 

With XULRunner you can use java classes right from your javascript code. So simply try this:

var str = new java.lang.String('Test string');
alert(str);

This behavior is available automatically thanks to LiveConnect feature of java plugin.

If you want to load your existing java library you'll have to play with classloader, for more details see my blog:

Calling java from XUL applications