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.
Everytime I create a Jpanel component, that I want to use several times within a frame, its Layout is destroyed because Netbeans resets the Layoutmanger after creation within the non editable region of initComponents by doing something like jPanel.setLayout(new GridbagLayout());. - I create a Jpanel - I set its Layout to GridBagLayout - I arrange a few Buttons one at 0,0 and one at 0,1 so they appear lined up vertical - I compile the panel and add it to the component Pallet as a link object - I create a JFrame - I set its Layout to GridBagLayout - I add the Jpanel from above from the Component Palette - Now I already see the buttons arranged horizontal this is because in the Jframe Source within the initComponent method Netbeans added a .setLayout() Command after the Constructor Call of the Jpanel. testPanel1 = new test.TestPanel (); testPanel1.setLayout (new java.awt.GridBagLayout ()); <--- here is the error line though it shouldn`t reset the Manager as it is already set within the Constructor of the panel. Resetting seems to destroy the Constraints that were set on the contained objects.
The bug is still present in Boston1087
This bug has the same originator as bug #7305 although the bug itself is slightly different. See Trung's Additional Comment for bug #7305. *** This bug has been marked as a duplicate of 7305 ***
Resolved for 3.3.x or earlier, no new info since then -> closing.