Article View: borland.public.jbuilder.java.swing
Article #8454How do I componentize some code in a class that extends JPanel...
From: David W. Taylor
Date: Wed, 23 Aug 2000 00:00
Date: Wed, 23 Aug 2000 00:00
31 lines
1649 bytes
1649 bytes
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:
<39a49222$1_1@dnews>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,54e65f6f18d18fd7,start X-Google-Attributes: gid111d45,public From: "David W. Taylor" <davidt@detayls.com> Subject: How do I componentize some code in a class that extends JPanel... Date: 2000/08/23 Message-ID: <39a49222$1_1@dnews> X-Deja-AN: 661801675 X-Trace: 23 Aug 2000 20:10:26 -0800, 216.15.88.178 X-MSMail-Priority: Normal X-Priority: 3 Newsgroups: borland.public.jbuilder.java.swing X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400