Re: Embedding an OCX into a JFrame

Vitaly Shelest <[email protected]> Wed, 3 Jan 2007 10:07:13 +0200
Newsgroups gmane.comp.windows.devel.jawin
Message-ID <[email protected]>
Hi Mark,
you can embed any native window into java Component (including SWING) with
sun.awt.EmbeddedFrame (the constructor accepts Native Window HWND). But this
class is abstract and to use it you have two options:
1) use class sun.awt.windows.WEmbeddedFrame that implements
sun.awt.EmbeddedFrame;
2) implement sun.awt.EmbeddedFrame by yourself.

Having created sun.awt.EmbeddedFrame Object initialize its private member
"dispatcher" (this can be done only from JNI Code) with
java.awt.LightweightDispatcher Object where Constructor's parameter is
sun.awt.EmbeddedFrame Object created before.

Regards,
Vitaly Shelest,
R&D,
Composia Software Ltd


"Mark Allen" <[email protected]> wrote in message
news:LISTSERV%[email protected]...
>I have an OCX that I need to embed into my java swing application.  I have
> used jawin in the past to access dll's, but I can't figure out how to do
> something like:
>
> jFrame.getContentPane.add(ocx)
>
> Mark.
>