Article View: borland.public.jbuilder.java.swing
Article #9473Re: How to implement zorder on swing component ...
From: John P. McGrath
Date: Sun, 26 Mar 2000 00:00
Date: Sun, 26 Mar 2000 00:00
25 lines
1543 bytes
1543 bytes
On Sat, 25 Mar 2000 15:07:37 -0800, mus wrote: > > > anyone seen code/way to set order of swing componet. > > > (Using null layout container) ..like zOrder in VB. > > > > You can right click on the component in the designer, and select > > "Move to First" or "Move to Last". > > What i realy mean is to set zorder at runtime :)))) Components are stored in a list in their parent Container, and the order of Components in this list is the controls the order in which the components are painted. I believe it also affects the tabbing order for AWT, but Swing uses a different mechanism for tabbing. The Container add() method adds a Component to the end of the list. There is a variant of add() that takes an index parameter, allowing you to add the component anywhere in the list. If you wish to modify the order, you will have to remove the Component, then add it at the new location. -- John P. McGrath <JPMcGrath@fast.net> <jpm@nscs.fast.net>
Technical Details
Message-ID:
<MPG.134884f9c801333b989828@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<8bh46s$e099@bornews.borland.com> <MPG.13461d603cdfc0b1989826@forums.borland.com> <8bho0t$mi71@bornews.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,ff57dde69e69246e X-Google-Attributes: gid111d45,public From: John P. McGrath <JPMcGrath@fast.net> Subject: Re: How to implement zorder on swing component ... Date: 2000/03/26 Message-ID: <MPG.134884f9c801333b989828@forums.borland.com> X-Deja-AN: 602773341 References: <8bh46s$e099@bornews.borland.com> <MPG.13461d603cdfc0b1989826@forums.borland.com> <8bho0t$mi71@bornews.borland.com> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing