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.
After designing a subpanel and going back to the parent, it happens. Form has become unusable. Build: NetBeans IDE 6.1 (Build 200805300101) VM: Java HotSpot(TM) Client VM, 1.5.0_06-b05, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_06-b05 OS: Windows XP, 5.1, x86 User comments: STACKTRACE: (first 10 lines) java.lang.IllegalArgumentException: Invalid size at org.jdesktop.layout.GroupLayout.checkResizeType(GroupLayout.java:223) at org.jdesktop.layout.GroupLayout.checkSize(GroupLayout.java:208) at org.jdesktop.layout.GroupLayout.access$500(GroupLayout.java:85) at org.jdesktop.layout.GroupLayout$GapSpring.<init>(GroupLayout.java:2851) at org.jdesktop.layout.GroupLayout$SequentialGroup.add(GroupLayout.java:1588) at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.fillGroup(SwingLayoutBuilder.java:317) at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.composeGroup(SwingLayoutBuilder.java:232) at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.fillGroup(SwingLayoutBuilder.java:253) at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.composeGroup(SwingLayoutBuilder.java:232) at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.createLayout(SwingLayoutBuilder.java:174)
Created attachment 77639 [details] Modified (broken) form
Created attachment 77640 [details] Original form
The broken form contains a space (gap) of negative size. It is in the vertical layout between jPanel1 and jPanel2. It causes the failure (negative size is not allowed). According to misterm this happened after designing jPanel1 (as separate container) and going back to the entire form. I tried in various ways but was not able to reproduce it (i.e. find out how the negative gap could have been created). Maybe it was fixed since 6.1. Do you know how to reproduce it? Without having the way to reproduce the original problem we can only make the GUI builder ignore/correct invalid gap sizes when loading the form. That would allow to open the form and continue working with it. I'm going to make this fix. For now you can fix the form manually - just search the .form file for pref="- string (i.e. 'pref' attribute with negative value, e.g. like pref="-281") and remove it (size will be reset to default).
Ok, some comments: - I actually designed jPanel2 as a separate container. - For some reason, the issue was reported as NB 6.1, but it happened to me in 6.5. I guess the first reporter used 6.1 and that's the stack that made it to the issue. - I have no further info on how to reproduce it. Thanks for your attention and time.
There is identical problem reported already, with some sample project attached and comment by former Form developer. I am marking this as a duplicate, so we can track it at once. So please add any new comments into the issue 135387. Thanks. *** This issue has been marked as a duplicate of 135387 ***