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.
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.
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
Anyway, we've got a different point of view for this issue ;) . Also some other user(s) expected this behaviour.
Verified. INV.