Article View: borland.public.jbuilder.java.swing
Article #1106Re: How do I get at the root pane of JApplet and it's members?
From: John McGrath [TeamB]
Date: Sat, 27 Mar 2004 10:40
Date: Sat, 27 Mar 2004 10:40
37 lines
2473 bytes
2473 bytes
On 3/26/2004 at 10:55:08 AM, Ted Byers wrote:
> I noticed that each time I put one or the other to the back,
> the order of these statements gets changed when I look at the
> source after making the change.
Yes, the z-order is controlled by the order that the child components
are added to a Container.
> Is it described somewhere that the order in which components
> are added to a pane determines their Z-order, and that the last
> component added will be behind the first? None of the references
> I have used describe this (in fact one says that if I want to
> control Z-order, I need to use the layered pane).
My first reaction to this was "sure, that should be *easy* to find",
but that turns out not to be the case. It seems that the Java specs do
not say that this is so.
But people needed to be able to control the z-order, and a quick look
at the code in package "java.awt" shows that it is controlled by the
order in which the components are added. Without any other documented
way to control the z-order (JLayeredPane did not yet exist), people
adopted this one, and it is now a de-facto way to do things.
Interestingly, JDK 1.5 will add new methods to the Container class that
allow you to control the z-order without removing components and adding
them again.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<40655a1d$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4061f46f@newsgroups.borland.com> <406366a8$1@newsgroups.borland.com> <406455b4$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,5588570eabbf8052 X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2004-03-27 03:09:29 PST From: "John McGrath [TeamB]" <ng-b@JPMcGrath.net> Subject: Re: How do I get at the root pane of JApplet and it's members? Newsgroups: borland.public.jbuilder.java.swing References: <4061f46f@newsgroups.borland.com> <406366a8$1@newsgroups.borland.com> <406455b4$1@newsgroups.borland.com> User-Agent: XanaNews/1.16.1.11 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 NNTP-Posting-Host: 151.197.242.55 Message-ID: <40655a1d$1@newsgroups.borland.com> Date: 27 Mar 2004 02:40:29 -0800 X-Trace: newsgroups.borland.com 1080384029 151.197.242.55 (27 Mar 2004 02:40:29 -0800) Lines: 37 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail