Article View: borland.public.jbuilder.java.swing
Article #10754Re: Please Helpe ME !!!!, Very Serious Problem using Visual Inheretence URGENT
From: Paul Furbacher [TeamB]
Date: Tue, 17 Aug 1999 00:00
Date: Tue, 17 Aug 1999 00:00
63 lines
2593 bytes
2593 bytes
Michel PΓ©rez wrote:
I don't know if this solves your problem, but it is apparent that
you have altered the code which JBuilder generated for you
in the "jbInit()" method. You have extended the class
from JPanel, and JBuilder originally wrote for you:
> private void jbInit() throws Exception
> {
> this.getContentPane().setLayout(borderLayout1);
> jButton1.setText("jButton1");
> this.getContentPane().add(jTabbedPane, BorderLayout.CENTER);
> //... I've deleted the rest which is irrelevant to the issue here
> }
> }
Note the "getContentPane()"! You just can't remove it on a whim.
This is a Swing issue. Had you extended from DecoratedFrame,
the "getContentPane()" is not generated.
> /////////////////////// NEW CLASS Test ////////////
>
> package ebank.econtainers;
>
> import ebank.econtainers.*; // not needed
Since this class "Test" is in the package "ebank.containers"
you don't need the "import" statement.
Additionally, from a design standpoint, the scope of a number of
instance variables in your "Container" class should be changed
from "package" to "class" level. That means that you should
add the keyword "protected" to the declaration of those instance
variables in "Container" to which you want subclasses to have
access. For some others, you may wish to restrict access to
only EContainer, hence the "private" keyword for the BorderLayout
here:
> public class EContainer extends JPanel {
>
> private BorderLayout borderLayout1 = new BorderLayout();
> protected JTabbedPane jTabbedPane = new JTabbedPane();
> protected JPanel jPanelContainerBusqueda = new JPanel();
> protected JPanel jPanelContainerManejo = new JPanel();
> protected JButton jButton1 = new JButton();
The code generator uses "package" scoping as the default.
Paul Furbacher (TeamB)
Technical Details
Message-ID:
<37B9A486.38BE4C8E@bilbo.bio.purdue.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7pbpc8$scg3@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 111d45,c3778a7af33dcb11 X-Google-Attributes: gid111d45,public From: "Paul Furbacher [TeamB]" <pf@bilbo.bio.purdue.edu> Subject: Re: Please Helpe ME !!!!, Very Serious Problem using Visual Inheretence URGENT Date: 1999/08/17 Message-ID: <37B9A486.38BE4C8E@bilbo.bio.purdue.edu> X-Deja-AN: 513876436 Content-Transfer-Encoding: quoted-printable References: <7pbpc8$scg3@forums.borland.com> Content-Type: text/plain; charset=iso-8859-1 Organization: Reverse Alchemy, Inc. Mime-Version: 1.0 Reply-To: pf@bilbo.bio.purdue.edu Newsgroups: borland.public.jbuilder.java.swing