This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 72662 - Custom initialization problem.
Summary: Custom initialization problem.
Status: VERIFIED INVALID
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-14 17:51 UTC by Peter Pis
Modified: 2006-10-23 15:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Pis 2006-02-14 17:51:52 UTC
Product Version         = NetBeans IDE Dev (Build 200602131900)
Operating System        = Windows XP version 5.1 running on x86
Java; VM; Vendor; Home  = 1.5.0_06; Java HotSpot(TM) Client VM 1.5.0_06-b05; Sun
Microsystems Inc.; d:\Java\jdk1.5.0_06

Custom initialization doesn't work if "Free Design" is set.

Steps:
1. Create new panel "APanel". Add some componets into it.
2. Create new frame "AFrame".
3. In "AFrame" (design view) add new Panel - "BPanel".
4. For "BPanel" to "Custom Creation Code" add "new APanel();"
5. Run "AFrame" and nothing is visible.

"Flow" layout should be used. Free design doesn't work in this case.
Comment 1 Jan Stola 2006-02-15 10:34:37 UTC
This is a misunderstanding. The custom initialization works.
APanel is used inside AFrame, but its original content is removed
because you defined another (empty) content of this panel in the designer.

The behaviour of GroupLayout and BorderLayout or FlowLayout is different because
the layout managed by BorderLayout is defined via add() methods
and the passed constraints. So, the layout is created incrementaly.
GroupLayout on the other hand requires a complete definition of the layout
set via setHorizontalGroup() and setVerticalGroup() methods. So, it is not
possible to merge the layout created in the designer with the layout
that exists in the default instance.

I wasn't sure whether to close this issue as INVALID or WONTFIX, but
this is a really strange use case. It is more a misuse of the form designer
than a bug => closing as INVALID.

I guess that the original use case was about addition of pre-created
container with components (e.g. APanel). This custom creation property
is not designed for such purposes. The APanel should be added as a bean
(for example through Palette) that has the 'container' property set to false
or 'containerDelegate' assigned. See
http://www.netbeans.org/kb/faqs/gui-editor-
matisse.html#FaqFormCustomContainerBean
Comment 2 Peter Pis 2006-02-25 08:54:23 UTC
Anyway, we've got a different point of view for this issue ;) . Also some other
user(s) expected this behaviour. 
Comment 3 Peter Pis 2006-03-22 09:20:32 UTC
Verified. INV.