Article View: borland.public.jbuilder.java.swing
Article #10738Re: Very Serious Problem using Visual Inheretence URGENT
From: wim.van.leuven
Date: Tue, 17 Aug 1999 00:00
Date: Tue, 17 Aug 1999 00:00
131 lines
4459 bytes
4459 bytes
Hello Michel,
In the code you have posted, the class Test descends from 'C'ontainer,
while the parent class you try to
use is 'K'ontainer. I do not know if this is your problem, but it could
be if you have cutted and pasted the code.
But I also have experienced that JBuilder cannot access subcomponents
from the parent class, because JBuilder analyses the code in the
memberfunction JBInit to visually access components that are locally
declared in the class. A possible workaround would be to give access to
your components through getters and setters, wich would be a more
correct OO approach to the problem.
Hope this helped,
Wim Van Leuven.
In article <7p1t5j$ij98@forums.borland.com>,
"Michel P�rez" <mperez@eurobanco.com> wrote:
> Hello World !
>
> I'm new using JBuilder 3, and I have a very big and serious problem.
I need
> that somebody help me as soon as posible.
> The matters is:
>
> I have designed a class that extends from JPanel with a JTabbedPane,
and two
> JPanels components in it, this class was created using the Panel
Snippet
> from new menu, this class is called by me (Kontainer). After that I
created
> a new class that extends from Kontainer using the snippet again, but
the
> problem is that my new class (Test) behavior is stranged because I
can't
> acces no one component in it. I need to solve this problem and I'm
very
> worry about that, below are the codes:
>
> //////// CLASS KONTAINER ///////////
>
> package ebank.kontainers;
>
> import java.awt.*;
> import javax.swing.*;
>
> public class Kontainer extends JPanel
> {
>
> BorderLayout borderLayout1 = new BorderLayout();
> JTabbedPane jTabbedPane = new JTabbedPane();
> JPanel jPanelContainerBusqueda = new JPanel();
> JPanel jPanelContainerManejo = new JPanel();
> protected OpContainer mOpContainer;
> JButton jButton1 = new JButton();
>
> public Kontainer()
> {
> try {
> jbInit();
> mOpContainer= null;
> }
> catch(Exception ex) {
> ex.printStackTrace();
> }
> }
>
> private void jbInit() throws Exception
> {
> this.setLayout(borderLayout1);
> jButton1.setText("jButton1");
> this.add(jTabbedPane, BorderLayout.CENTER);
> jTabbedPane.add(jPanelContainerBusqueda, "Busqueda de ");
> jTabbedPane.add(jPanelContainerManejo, "Manejo de ");
> jPanelContainerManejo.add(jButton1, null);
> }
> }
>
> /////////////////////// NEW CLASS TEST ////////////
>
> package ebank.containers;
>
> import javax.swing.*;
>
> public class Test extends Container {
>
> public Test() {
> try {
> jbInit();
> }
> catch(Exception e) {
> e.printStackTrace();
> }
> }
>
> private void jbInit() throws Exception {
> }
> }
>
> I have tried many possible solutions, like change all data member
acces to
> public in the class father (Kontainer), and so on, but everything
was
> unsuccessfully.
>
> I don't know if JBuilder 3 have a bug and is impossible handle Visual
> Inherentence. Does somebody have tried something like this ? I don't
know
> if the trouble is that my father class (Kontainer) extends from
JPanel and
> that generates the problem. I need to extends my father class from
JPanel or
> an container like this. What could I do ?
> How could I use visual inheretence and add more component in the
child
> class, without get a an error ?
> Please HELP ME !!!
>
> I'm desperated......
>
> Thank you very Much
>
> Michel P�rez
>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Technical Details
Message-ID:
<7pbcfi$mln$1@nnrp1.deja.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7p1t5j$ij98@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 111d45,e1b314c03d055c2d X-Google-Attributes: gid111d45,public From: wim.van.leuven@watco.be Subject: Re: Very Serious Problem using Visual Inheretence URGENT Date: 1999/08/17 Message-ID: <7pbcfi$mln$1@nnrp1.deja.com> X-Deja-AN: 513724626 References: <7p1t5j$ij98@forums.borland.com> X-Http-Proxy: 1.0 x33.deja.com:80 (Squid/1.1.22) for client 193.74.148.90 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Tue Aug 17 10:11:01 1999 GMT X-MyDeja-Info: XMYDJUIDvlv Newsgroups: borland.public.jbuilder.java.swing X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)