When adding panels to the JTabbedPane the code generation incorrectly adds a
setLayout(new BorderLayout()) to the code after the panels have been created,
causing the panels to appear empty when the code is compiled.
Some example generated code is as follows:
This appeared in recent development builds, somewhere before dev-133.
Those searchPanel, downloadPanel, etc. - I suppose they are of some separate
classes (not JPanels designed in the same form)? If so, then they should be in
ComponentPalette, so you can set their "isContainer" properties to false (as
they have its own content, you don't want use them as container for further
components). Does this workaround work?
The panels are separate beans, and I've not been using the component palette.
What I do is do a 'copy' on the object, and paste it into the tabbed panel. I
will try your workaround, and let you know.
Okay, I added the panels to the Component Palette, went into Options|Component
Palette, changed the isContainer property to 'false' for all of the beans, and
dropped them into the JTabbedPane, and everything worked great. I was even able
to see the underlying GUI, great job on the new designer.
Would it make sense to allow the user to change the 'isContainer' property from
the Component Inspector? Perhaps under 'Code Generation'? Then my cut and paste
would work, as long as I knew to set the isContainer property to false in Code
Generation for that component. Just a thought. The current workaround, although
cumbersome for me (I rarely use the component palette for this kind of work),
will keep me happy for now.
I've also fixed the redundant setLayout(...) code generation (if layout is not
changed). I've added the suggestion to set "isContainer" property from
Component Inspector to bug 6756, which is our "reference" bug for
the "container beans problem".
So this bug can be marked fixed.
verified in[nb-dev](137), [pilsen](010306)
Resolved for 3.3.x or earlier, no new info since then -> closing.