[309] in java-interest
Re: access to container or window
daemon@ATHENA.MIT.EDU (Mark Little)
Wed Jun 14 11:38:43 1995
Date: Wed, 14 Jun 1995 16:09:01 +0100
From: Mark Little <M.C.Little@newcastle.ac.uk>
To: java-interest@java.sun.com
> ----- Begin Included Message -----
>
> A lot of the classes like List, TextField etc. need a container which can be
> a form or a window. where do I get this variable from inside my applet
> subclass ?
>
> __Sven
> -
>
> ----- End Included Message -----
>
> Hello Sven,
> I don't know if it's a good idea to do it, but you can always access the
> applet's item.parent, which is a DisplayItemWindow. so whitin an applet you
> could address this window with this.item.parent .
I'm not sure if this was the correct way of doing things, but for
an application I wrote which used windows, buttons, etc I first
created a fram and then a window with this frame as its parent:
f = new Frame(WServer.theServer, false, null, 100, 128, Color.lightGray);
win = new Window(f, "foo", Color.lightGray, 100, 128);
<other stuff deleted>
f.map();
The call to f.map() maps the frame onto the screen along with any of its
children (contents). If I had not put a window into f then it would come
up grey (gray). This example uses the default WServer, which is in
awt.WServer.
Hope this helps,
Mark.
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com