Imbedding java apps in tk??

0 views
Skip to first unread message

M.Ranganathan

unread,
Jan 14, 1999, 3:00:00 AM1/14/99
to
mo wrote:

> "M.Ranganathan" wrote:
> >
> > Hello!
> >
> > I am toying with the idea of imbedding java apps in a tk canvas. (The
> > idea being thattcl/tk is the integration framework and the components
> > are java.) Does anybody know if this can be done ? (and has anbody done
> > it?)
> >
> > Thanks.
> >
> > Ranga.
>
> Combining Tk widgets and Java widgets is not really supported by
> TclBlend.
> One workaround I have used is to create a Java window over an existing
> Tk
> window without a border. This worked for the application I was writing
> because the Java window was only needed for a short time (I used a
> java Frame object to play an MPEG video clip over an existing Tk window
> using the Java Media Framework and my own Tcl-JMF package).
>
> I hope that helps
> mo dejong
> dejong at cs.umn.edu

I dont really want to combine java and tcl widgets. The question I have is
really more of a java question than a tcl question. I was wondering if I can
supply a top level window (other than the root window) to a java gui
application and have it use that window as its top level window. In that
case, one may effectively imbed java applications in a tcl canvas (just as
one can do with tk applications today - you can supply wish a top-level
window id. ).

Ranga.


mo

unread,
Jan 16, 1999, 3:00:00 AM1/16/99
to


This question seem to come up a lot. Lots of people seem to want to
do it and they keep asking "is it possible to ...". Sure anything is
possible. I think it would really help if someone went out and did it.
You can write code in Java that will find the native X window id and
then you could pass that to Tk. Of course, that will not work on Windows
boxes and it will tie the code to a JVM impl but life is like that.
Are you interested in trying that out and telling us how it went?
I would be willing to help all I could but I have no pressing need for
this feature so I am not going to code it.


later

Jacob Levy

unread,
Jan 17, 1999, 3:00:00 AM1/17/99
to
mo

Have a look in the peer packages, there's classes called MEmbeddedFrame and
WEmbeddedFrame. You'll note the constructor takes a 32 bit integer. On Unix this
is
an X11 WINDOW, on Win32 this is a HWIN. That should be enough to get the Java app
to appear inside a Tk frame.

Good luck,

--JYL

mo

unread,
Jan 18, 1999, 3:00:00 AM1/18/99
to
My point was that this type of this is possible and should not be that
hard to do. I am not going to be the one to do this right now because
I have not need for it. If there are folks out there that do need this
kind of feature then please consider working on a prototype. All we
need is for a couple of people to get some code written. I would be
willing to provide and advice and help that I could but I am not going
to write the code myself.

later
mo dejong
dejong at cs.umn.edu

Robin Becker

unread,
Jan 19, 1999, 3:00:00 AM1/19/99
to
In article <36A3DCF0...@spam.com>, mo <n...@spam.com> writes

>My point was that this type of this is possible and should not be that
>hard to do. I am not going to be the one to do this right now because
>I have not need for it. If there are folks out there that do need this
>kind of feature then please consider working on a prototype. All we
>need is for a couple of people to get some code written. I would be
>willing to provide and advice and help that I could but I am not going
>to write the code myself.
>
>later
>mo dejong
>dejong at cs.umn.edu
>
>
>Jacob Levy wrote:
>>
>> mo
>>
>> Have a look in the peer packages, there's classes called MEmbeddedFrame and
>> WEmbeddedFrame. You'll note the constructor takes a 32 bit integer. On Unix
>this
>> is
>> an X11 WINDOW, on Win32 this is a HWIN. That should be enough to get the Java
>app
>> to appear inside a Tk frame.
.
>
...

I just tried exactly this kind of thing with a GVIM toplevel window
under win95. I used a frame with -container 1 and then used a win api
call to transfer ownership of the window from the desktop to the frame.
There was a mismatch between the manager protocols though so I got root
window behaviour for GVIM, but inside my frame; a bit like MDI, but
wrong.
--
Robin Becker

Reply all
Reply to author
Forward
0 new messages