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.
Created attachment 111731 [details] Project demonstrating the problem This issue is inspired by the first test-case in issue 203129. Steps to reproduce: 1. Open the attached project. 2. Open NewJFrame.java in Design mode. 3. Move jButton3 to the left such that it snaps at the small preferred gap next to jButton2. => notice that there is no gap in the resulting layout. 4. Select jButton2 and invoke Space Around Component ... => the dialog shows that the size of the right gap is negative (-219 in my case). 5. Cancel/close the Space Around Component dialog. 6. Execute the form. => the following exception is thrown java.lang.IllegalArgumentException: Invalid size at javax.swing.GroupLayout.checkResizeType(GroupLayout.java:337) at javax.swing.GroupLayout.checkSize(GroupLayout.java:322) at javax.swing.GroupLayout.access$500(GroupLayout.java:191) at javax.swing.GroupLayout$GapSpring.<init>(GroupLayout.java:3088) at javax.swing.GroupLayout$Group.addGap(GroupLayout.java:1516) at javax.swing.GroupLayout$SequentialGroup.addGap(GroupLayout.java:1810) at javaapplication52.NewJFrame.initComponents(NewJFrame.java:72) at javaapplication52.NewJFrame.<init>(NewJFrame.java:18) at javaapplication52.NewJFrame$3.run(NewJFrame.java:181) ... The exception is caused by .addGap(GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) call that corresponds to the mentioned negative gap. GroupLayout.DEFAULT_SIZE is not allowed as a minimum size of a gap.
http://hg.netbeans.org/jet-main/rev/89a044270c75
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/89a044270c75 User: Tomas Pavek <tpavek@netbeans.org> Log: #203394: component behind a border gap can be in subgroup (was skipped)