🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #1208

Re: JLayeredPanes are not showing up!

#1208
From: John McGrath [TeamB]
Date: Thu, 12 Feb 2004 15:37
28 lines
1751 bytes
On 2/7/2004 at 3:42:28 PM, Ishan wrote:

> I can't get his code to work.
> The layers will not display.

The reason that the layered pane does not display anything is that it
is not supposed to.  It is simply a container for holding other
components.

The reason that the labels do not display is because nothing has set
their sizes, so they all have a size of [0,0].  The layered pane does
not manage the bounds for the components that it contains, so you have
to provide the code to do that.

If you add the following code, you will see the labels.

   lb.setSize( lb.getPreferredSize() );
   lb2.setSize( lb2.getPreferredSize() );
   lb2.setLocation( 0, 20 );

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <402b9dcc$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40254db4$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,bdb19836988117a7
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2004-02-12 07:40:35 PST
From: "John McGrath  [TeamB]" <ng-b@JPMcGrath.net>
Subject: Re: JLayeredPanes are not showing up!
Newsgroups: borland.public.jbuilder.java.swing
References: <40254db4$1@newsgroups.borland.com>
User-Agent: XanaNews/1.15.8.5
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
NNTP-Posting-Host: 151.197.15.67
Message-ID: <402b9dcc$1@newsgroups.borland.com>
Date: 12 Feb 2004 07:37:48 -0800
X-Trace: newsgroups.borland.com 1076600268 151.197.15.67 (12 Feb 2004 07:37:48 -0800)
Lines: 28
X-Authenticated-User: jpmcgrath
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail