🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #1204

Re: Custom GUI in designer

#1204
From: Paul Furbacher
Date: Wed, 11 Feb 2004 18:15
52 lines
2747 bytes
Eugene Lukin wrote:

> I'm using a kind of custom container (a subclass of JFrame)
> which uses its own method of adding child components.
> 
> Swing:
>     frame.getContentPane().add(childComp);
> 
> My:
>     frame.addChild(childComp); // contains Swing adding plus some
>                                // specific (very important!)
> actions.
> 
> Is it possible to tune JBuilderX that it will either:
> 1) Recognize this custom code and build correct component tree in designer.
> 2) Generate custom component adding as a result of visual GUI design?

Probably not, but if it is possible, it may require more
work than it's worth (like writing an Open Tool or something).

> I know how eliminate getContentPane call but
> what chould I do with add() ?
> 
> Obviously it's possible to change my container interface
> to fit JBuilder style but this is not acceptable to me.

In a way, you are saying that your chosen method, "addChild()",
is the _only_ way to solve this, but there's no "only way"
in software design and development.

I can see a much more compatible approach, and one
with is equally object-oriented: override the
"getContentPane()" method in your subclass of JFrame.
Provide a content pane class with an overridden "add()"
method.  Then, do the business which is now in your
"addChild()" method in that overridden "add()" method.


-- 


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: <402a7147$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <402a40a3$2@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,cfba54eb4587e496
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2004-02-11 10:41:15 PST
Date: Wed, 11 Feb 2004 13:15:36 -0500
From: Paul Furbacher <pfurbacher@mac.com>
User-Agent: Mozilla Thunderbird 0.5 (Macintosh/20040208)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing
Subject: Re: Custom GUI in designer
References: <402a40a3$2@newsgroups.borland.com>
In-Reply-To: <402a40a3$2@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: <402a7147$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1076523335 68.39.103.120 (11 Feb 2004 10:15:35 -0800)
Lines: 52
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail