Embedding XULRunner application on Java - java

My goal is to get Limewire(JAVA) and Songbird(XULRunner) to run together.
I was thinking the best way is to run the XUL application(songbird) inside a JAVA swing panel. Is there another way?
Would it be better or possible to have the GUI entirely in XUL, and then access my JAVA objects somehow?
How would I go about doing this?
Thanks

Take a look at JRex, as it might let you peek into a couple of ideas.
Other than that, I'd also research about Rhinohide as well.

Take a look at DJ Native Swing, a native Swing implementation using SWT and Xulrunner.

I am currently researching XUL for a new product and I came across JavaXPCOM which allows Java code to interact with XPCOM objects. I'm still wrapping my head around the Mozilla stack, but from what I understand all XULRunner applications use XPCOM. Therefore, it seems like you should be able to embed Songbird with this approach.

The official XUL implementation by Mozilla and is heavily dependent on Gecko.
Gecko is not written in Java nor embedded in AWT/Swing/SWT (at least without using JNI).
So, the short answer is: no. You must either use JNI or use heavy, complex and incomplete third party libaries.
However, JavaXPCOM seems to allow embedding Gecko: https://developer.mozilla.org/en/JavaXPCOM
But in that case you'll depend on Gecko... and I don't know if that's enough to run Songbird.

I would examine Limewire's source code. If there's a clean separation between UI and the rest of the application, I would try finding a solution to instantiate and invoke Limewire's non-UI code from within a Songbird extension.

I would take a look at eclipse swt's embedding of
xulrunner:
http://www.eclipse.org/swt/faq.php#whatisbrowser

Related

directshow what is the best component to use

hi every one there please i need some info
i have created app using directshow &c++ for image processing
so the thing is that i need to create a sophisticated GUI i have used win32 components which don't fulfill my needs and my expectations plus difficult to tweak specailly with events
so i got to find a solution i thought about using jni and merge c++'s functionality with java's the swing components .
the other choice is to use the window form(.net) but if i'm right i need to use directshow.net (i don't know how to use it )
Qt is most often called the best C++ framework for building GUIs.
Windows Forms is quite nice. Don't be afraid of using DirectShow.Net, it looks very similar to C++ but easier. You can take a look at GraphEditPlus, it can generate DirectShow graph building code in both C++ and C# (for DirectShow.Net), so you can see how semantically the same code looks in two languages. Also, GraphEditPlus itself is an example of Windows Forms application working with DirectShow.
"but if i'm right i need to use directshow.net".
No, not really. You can create an activex control in C++ that wraps your current code and use that instead in .Net with Windows.Forms.

How to get control of Windows of WindowXP using Java

I need to get control over Windows of WindowsXP using Java code,
I need to click/type on particular button/textfield of given window of windowsXP,
How to do this any idea?
Approaches I tried are:
(1) I Tried AutoIT framework, but its Java Wrapper is buggy.. not stable.
(2) JNA can be used for native interfacing, by using some .dll file
to achieve the same. But I don't know which .dll file is used by windowsXP.
Can anybody elaborate on this?
I've not much idea which is much better solution.
Is there any better framework available for such thing.
Thanks.
WindowsXP uses multiple dll files, not one, and studying its API will tell you which one has which functions, and then you can use this information in your JNA interaction code. BTW, I have use AutoIt by itself to help do what you're trying to do and it works fine, and is easier than Java with JNA since it's built for this sort of thing. I've also used AutoIt with Java by having Java call small AutoIt programs and get some simple interaction via standard input and output streams taking care though of the tips and traps in this great article: When Runtime.exec() won't

Java global keypress?

For my program i need to register key events that happen without the application having the focus. (i.e. internet explorer having the focus) I have been looking and people say you can do it with jni; however, is there anyway to do it without it?
Can someone give me a link of a really good jni example? the ones i have looked at so far havent been very helpful
JIntellitype (which is an Apache 2.0 license) will do this for you in Windows. JxGrabKey appears to be a valid solution for Linux. I'm not aware of a cross-platform solution. (These still use JNI, but they'll abstract the details for you)
http://melloware.com/products/jintellitype/index.html
http://sourceforge.net/projects/jxgrabkey/
Do you want to create a key logger? No, it is not possible without JNI or using some library which wraps the JNI away for you.
The only way in Java to do things outside of your own Frames/Windows is using java.awt.Robot, but this only allows screenshots and sending input to other programs, not capturing input.

How can I host a Java Swing component in a .NET application

I have some Java user interface controls that I want to host in my .NET application as I can't afford to rewrite them. How can I do that? Do I need to wrap them up in COM? How do I do that? I want the component to sit on a form with other components written in .NET.
If you're using VS2005, have you considered compiling said Java component in J#?
I've never tried J#, but I seem to recall Microsoft claiming that it would convert Swing calls to their WinForms equivalent.
There's no way to force this high level of integration; you cannot make a .NET form host a Java component. Even COM wrapping wouldn't get you the level of integration necessary to host the component in the form.
Conceptually I find it almost impossible to believe that it is possible to do this.
However, you might try migrating the existing components to J#.
There's a product called JNBridge that claims to do this - I've never heard of it before.
See also, this previous post.

Are there any Java libraries which I can use for automated testing of Windows GUIs?

Currently I am doing automated integration testing using FitNesse (Java) and have successfully plugged-in Watij to access a web-based application. I would like to extend this to also drive Windows GUI (non-Java) applications. To this end, are there any Java libraries available which I can use in a similar way?
Matt,
I don't think you are going to be able to test your non-java GUIs with Java libraries.
That being said, you could take a look at AutomationAnywhere (.com) and see if that fits your needs. This tool is very robust and very expensive, which may not be an issue if your company is going to pay for it. You might try a free trial out and see what you think.
Good luck,
-Robert
Abbot is one that I'm aware of, which is nice and free. I don't know if that will fit your your situation. You might also look at UISpec4J.
There are Java based (commercial) tools for GUI testing like Squish or GUIdancer.
If they do not already expose a Java API I am sure that you can talk to their support to add such a feature.

Categories

Resources