Article View: borland.public.jbuilder.java.swing
Article #1181Re: the red component mistery
From: Paul Furbacher
Date: Thu, 29 Jan 2004 23:23
Date: Thu, 29 Jan 2004 23:23
53 lines
2908 bytes
2908 bytes
Sven Goetgeluck wrote:
> hi ,
> when using my dialogs in jb 9 i'll get a red component in design mode
> what can i do about it?
> all my dialogs are extended from myescdialog so i dont have to put all the
> code agian for reacting on esc button press
>
> a.. Failed to create live instance for variable 'this'.
> components.dialogs.MyESCDialog
> b.. Failed to create live visual subcomponent this as
> components.dialogs.MyESCDialog(cls); creating a red component in its place
>
> is there a wourk around??
The JBuilder Help discussion on "red beans"
indicates why this happens: the Designer
cannot instantiate a class which does not
have a no-parameter constructor. Dialog
and its descendants violate that requirement;
hence the red bean. The Help also says that
one should consult the Release Notes in the
JBuilder installation directory.
To get around this with dialogs, one typically designs
the components (sub-panels) of a dialog as separate
classes (extensions of JPanel) and uses those
in a new JDialog. That is, one doesn't subclass
JDialog. So, in your case, where you seem to
have a button which you want to use in a number
of dialogs, you would create a class which extends
from JPanel, call it "MySpecialButtonPanel", place
your button on it, add accessor/mutator methods
to get at the button (e.g., to add/remove listeners),
and add that panel to any new dialog you create.
--
Paul Furbacher (TeamB)
Save time, search the archives:
http://www.borland.com/newsgroups/ngsearch.html
Is it in Joi Ellis's Faq-O-Matic?
http://www.visi.com/~gyles19/fom-serve/cache/1.html
Finally, please send responses to the newsgroup only.
That means, do not send email directly to me.
Thank you.
Technical Details
Message-ID:
<401995d7$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4019791d$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,13c33929f7fcff3b X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2004-01-29 15:39:57 PST Date: Thu, 29 Jan 2004 18:23:04 -0500 From: Paul Furbacher <pfurbacher@mac.com> User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing Subject: Re: the red component mistery References: <4019791d$1@newsgroups.borland.com> In-Reply-To: <4019791d$1@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 68.39.103.120 Message-ID: <401995d7$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1075418583 68.39.103.120 (29 Jan 2004 15:23:03 -0700) Lines: 53 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail