View Full Version : Embedding Java in Qt

1st February 2006, 16:23
Has anyone experience or knowledge of how to embed a Java Swing app within a C++ based Qt application?

I'm aware of QtJava but I understand this is just a JNI wrapper around the C++ Qt.
I am also aware of how to invoke a JVM from C++ but I would like a solution for embedding the Java Swing Gui withing a Qt Frame of some sort so the Java looks as if it is part of the already exisiting C++ Qt application.

Would it be possible to accomplish something like
QtC++ app -> QtJava model -> Java Swing view ??


4th February 2006, 12:46
It is possible to embed a X11 window inside a Qt widget (at least I think so), but I doubt anyone did that for Java windows. I guess it is achievable but probably heavily platform dependent. You'd have to use Xlib to get the window id of your java window and then embed it into Qt somehow. For Windows -- I don't know.

27th February 2006, 16:45
See an article at
Maybe it will help you:)