Article View: borland.public.jbuilder.java.swing
Article #8480Re: How do I componentize some code in a class that extends JPanel...
From: Greg Hamer
Date: Mon, 28 Aug 2000 00:00
Date: Mon, 28 Aug 2000 00:00
41 lines
1929 bytes
1929 bytes
Sounds like you are not calling pack() after adding all the children to MYPanel. "David W. Taylor" <davidt@detayls.com> wrote in message news:39a49222$1_1@dnews... > Hi! > > I have a very nice little editor that I would like to use in six more > places. > > The code is currently sitting inside a JInternalFrame but all of the > important editor components are inside a single JPanel in the center of a > Borderlayout, which comprises the main part of the view. > > The JPanel in question holds a JTabbedPane, which has two panels, where the > editing occurs. > > My first attempt here was to create my own subclass MYPanel of JPanel and > move all the relevant code to that new class, but when I do that the > instance of MYPanel that is now created is invisible and of zero size. > > The loading of the editor all works and I can open data and hear it arrive > and see the reactions of menu items and toolbar buttons but obviously I need > to do something in MYPanel to cause the JPanel it extends to gain size and > paint itself. > > Are there any super() calls that I need to worry about in MYPanel? To put > it another way, is Swing calling MYPanel to do something that MYPanel is > ignoring? > > Thanks in advance for any advice or samples that you may have. > > David > > -- > David W. Taylor, Detayls > > >
Technical Details
Message-ID:
<8oe36l$n2f9@bornews.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<39a49222$1_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,54e65f6f18d18fd7 X-Google-Attributes: gid111d45,public From: "Greg Hamer" <ghamer@corp.netzero.net> Subject: Re: How do I componentize some code in a class that extends JPanel... Date: 2000/08/28 Message-ID: <8oe36l$n2f9@bornews.borland.com> X-Deja-AN: 663529797 References: <39a49222$1_1@dnews> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.swing