Article View: borland.public.jbuilder.java.language
Article #19912Re: Frame/Window
From: Carl Hewitt
Date: Sun, 23 Nov 1997 00:00
Date: Sun, 23 Nov 1997 00:00
42 lines
2035 bytes
2035 bytes
That is what I am doing for now, but it is a pain. I am going to forward the
question to Javasoft and see if the will put something in the Toolkit or System
classes.
Carl
Gary McGath wrote:
> In article <3475E14E.AE4B0525@wli.net>, pagan@well.com wrote:
>
> >Hi Carl,
> >
> >Try this:
> >
> > Container f = getParent();
> > while(f != null && !(f instanceof Frame)) {
> > f = f.getParent();
> > }
> > if (f == null) {
> > System.out.println("Couldn't get applet's frame.");
> > return;
> > }
> >
> >Good luck, roger :~)
> >
> >
> >Carl Hewitt wrote:
> >
> >> How do I find the topmost window in an application?
>
> I don't think that's what he was asking. Windows aren't linked by getParent().
>
> And it does look like a tough question, even if you try to track the
> frontmost window explicitly. Probably the best bet is to monitor the
> WINDOW_ACTIVATED event in each window, and set a variable which indicates
> which window most recently received that event; but it's not clear that
> "activated" always implies "frontmost."
>
> --
> Gary McGath gmcgath@ultranet.com
> http://www.ultranet.com/~gmcgath
Technical Details
Message-ID:
<34782224.2A38EB17@oop.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<347440C3.D0B76A6B@oop.com> <3475E14E.AE4B0525@wli.net> <gmcgath-ya02408000R2111972049260001@news.ma.ultranet.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10a146,753c9b5de73c4539 X-Google-Attributes: gid10a146,public X-Google-Thread: f74b3,753c9b5de73c4539 X-Google-Attributes: gidf74b3,public X-Google-Thread: 10fd6d,753c9b5de73c4539 X-Google-Attributes: gid10fd6d,public X-Google-Thread: fecd1,753c9b5de73c4539 X-Google-Attributes: gidfecd1,public From: Carl Hewitt <carl@oop.com> Subject: Re: Frame/Window Date: 1997/11/23 Message-ID: <34782224.2A38EB17@oop.com> X-Deja-AN: 291795088 References: <347440C3.D0B76A6B@oop.com> <3475E14E.AE4B0525@wli.net> <gmcgath-ya02408000R2111972049260001@news.ma.ultranet.com> Reply-To: carl@oop.com Organization: oop.com Newsgroups: borland.public.jbuilder.java.language,comp.lang.java.gui,comp.lang.java.programmer,comp.lang.java.api