Discussion:
java panels in native QT application?
Sandor Brockhauser
2006-01-16 15:35:46 UTC
Permalink
Hi,

I would like to integrate my java (swing) panels into an existing Qt
application.
As far as I see, KDEJAVA can be used to build nativ Qt guis in java, but
(for my curiosity:)
Can it be also used for integrating Qt widgets (even a basic canvas)
into a swing (or awt/swt) application?
Would you have any suggestion how to integrate my existing java (swing)
panels into my separate Qt application?

Thank you,
Sandor
Anders Norgaard
2006-01-16 15:54:37 UTC
Permalink
Post by Sandor Brockhauser
Hi,
Hi Sandor,

I am no expert on KDEJAVA - so I'm just telling you what my
understanding of the situation is.


KDE java and QT java are (now at least) java classes that mirror the
api of KDE and QT classes. When you call methods on the java classes
the call is passed on via JNI to the "real" QT/KDE library.
There is no connection between the QT/KDE java classes and the SWING API.
Post by Sandor Brockhauser
I would like to integrate my java (swing) panels into an existing Qt
application.
As far as I see, KDEJAVA can be used to build nativ Qt guis in java, but
(for my curiosity:)
Can it be also used for integrating Qt widgets (even a basic canvas)
into a swing (or awt/swt) application?
I'd say no. As none of the QT/KDE java classes have the type
JComponent or whatever the class you can add to swing apps is called.
Post by Sandor Brockhauser
Would you have any suggestion how to integrate my existing java (swing)
panels into my separate Qt application?
I think that the easiest by far would be to "port", that is rewrite,
one of the applications. Either write new QT panels in stead of the
swing ones you have. Or write a swing application and then integrate
your swing panels. The api's are not that different, so if you have a
basic design, you won't need to change much.

Hope I am of help, and that I dont misguide you,
Anders
Post by Sandor Brockhauser
Thank you,
Sandor
_______________________________________________
Kde-java mailing list
https://mail.kde.org/mailman/listinfo/kde-java
Michael O'Keeffe
2006-01-19 01:59:08 UTC
Permalink
[snip]
Post by Anders Norgaard
Post by Sandor Brockhauser
Would you have any suggestion how to integrate my existing java (swing)
panels into my separate Qt application?
I think that the easiest by far would be to "port", that is rewrite,
one of the applications. Either write new QT panels in stead of the
swing ones you have. Or write a swing application and then integrate
your swing panels. The api's are not that different, so if you have a
basic design, you won't need to change much.
Perhaps somewhere between using the AWT Native Interface as mentioned, and
porting your app (and definitely that might be the best over the long run,
maintenance-wise, depending on how big the app is) would be to use
something like CORBA. I'm using omniORB, with Qt/Win.

-Mike

Tom Tromey
2006-01-16 19:02:50 UTC
Permalink
Sandor> Can it be also used for integrating Qt widgets (even a basic
Sandor> canvas) into a swing (or awt/swt) application? Would you have
Sandor> any suggestion how to integrate my existing java (swing)
Sandor> panels into my separate Qt application?

Look at the AWT Native Interface. This lets you mix AWT windows with
platform native windows in some ways. E.g., this is how Eclipse
manages to embed Swing windows.

Tom
Loading...