Thread View: borland.public.jbuilder.java.swing
2 messages
2 total messages
Started by Eugene Lukin
Wed, 11 Feb 2004 14:48
Custom GUI in designer
Author: Eugene Lukin
Date: Wed, 11 Feb 2004 14:48
Date: Wed, 11 Feb 2004 14:48
26 lines
1625 bytes
1625 bytes
Hello, All!
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
// spcific (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?
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.
Thanks in advance.
Eugene
Re: Custom GUI in designer
Author: Paul Furbacher
Date: Wed, 11 Feb 2004 18:15
Date: Wed, 11 Feb 2004 18:15
52 lines
2747 bytes
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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads