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.
Java 1.6.0-b105 NB 6 Dev (200701041900) NB 5.5.1 (200701030600) "Align Left in Column" function throws exception. java.lang.IllegalStateException: javax.swing.JLabel[,30,51,34x14,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=8388608,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,horizontalAlignment=LEADING,horizontalTextPosition=TRAILING,iconTextGap=4,labelFor=,text=jLabel3,verticalAlignment=CENTER,verticalTextPosition=CENTER] is not attached to a horizontal group at org.jdesktop.layout.GroupLayout.checkComponents(GroupLayout.java:986) at org.jdesktop.layout.GroupLayout.prepare(GroupLayout.java:940) at org.jdesktop.layout.GroupLayout.layoutContainer(GroupLayout.java:806) Steps to reproduce this bug: 1.Create empty form 2.Put first label into left top form corner using horizontal and vertical alignment guidelines 3.Put second label beneath first label but shift it right using preferred margin 4.Put third label approx. 2cm beneath second one and indent it also 2cm right (see layout1.jpg) or put third label beneath second label and also shift it right using preferred margin (see layout2.jpg)
Created attachment 37072 [details] Layout 1
Created attachment 37073 [details] Layout 2
Created attachment 37074 [details] Exception
Reproducible. The first exception seems to be java.lang.AssertionError at LayoutInterval.getCurrentSpace(LayoutInterval.java:448) at LayoutAligner.getPosition(LayoutAligner.java:488) at LayoutAligner.splitByAlignAttrs(LayoutAligner.java:289) at LayoutAligner.alignIntervals(LayoutAligner.java:68) at LayoutDesigner.align(LayoutDesigner.java:1890) at FormDesigner.align(FormDesigner.java:1207) at FormDesigner$AlignAction.actionPerformed(FormDesigner.java:2309)
Reproducible in NB 200804280002 DEV build. I have tested the scenario displayed in Layout2 example. I placed the three labels, I selected all of them and invoked "Align > Left To Column" from the pop-up menu over selection. A NPE was thrown. The same exception was thrown when invoked Right To Column... java.lang.NullPointerException at org.netbeans.modules.form.layoutdesign.LayoutDesigner.paintAlignment(LayoutDesigner.java:1301) at org.netbeans.modules.form.layoutdesign.LayoutDesigner.paintSelection(LayoutDesigner.java:1185) at org.netbeans.modules.form.layoutdesign.LayoutDesigner.paintSelection(LayoutDesigner.java:1124) at org.netbeans.modules.form.HandleLayer.paintSelection(HandleLayer.java:290) at org.netbeans.modules.form.HandleLayer.paintComponent(HandleLayer.java:235) at javax.swing.JComponent.paint(JComponent.java:1027) at javax.swing.JComponent.paintChildren(JComponent.java:864)
Created attachment 60738 [details] stack trace
*** Issue 132437 has been marked as a duplicate of this issue. ***
*** Issue 141695 has been marked as a duplicate of this issue. ***
This issue has already 5 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=45210
Build: NetBeans IDE 6.5 Beta (Build 200808111757) VM: Java HotSpot(TM) Client VM, 10.0-b23, Java(TM) SE Runtime Environment, 1.6.0_07-b06 OS: Windows XP, 5.1, x86 User Comments: dfriesen: I had selected multiple objects in the IDE design viewer and then attempted to automatically align them by using the left justify button. After the left justify button was pressed the exception then occured. carentrica: Trying to align several controls horizontally in the GUI Designer using the horizontal alignment toolbar button. frafel: After selected two text field I tried to align bottom or top and both actions produce this exceptions. Regards exlons: select multi labels and set same size, then set default size, and set horizontal alignment using tool bar icon. then is happened. dfriesen: I had selected multiple objects in the IDE design viewer and then attempted to automatically align them by using the left justify button. After the left justify button was pressed the exception then occured. Stacktrace: java.lang.AssertionError at org.netbeans.modules.form.layoutdesign.LayoutInterval.getCurrentSpace(LayoutInterval.java:494) at org.netbeans.modules.form.layoutdesign.LayoutAligner.getPosition(LayoutAligner.java:510) at org.netbeans.modules.form.layoutdesign.LayoutAligner.splitByAlignAttrs(LayoutAligner.java:311) at org.netbeans.modules.form.layoutdesign.LayoutAligner.alignIntervals(LayoutAligner.java:90) at org.netbeans.modules.form.layoutdesign.LayoutDesigner.align(LayoutDesigner.java:2864) at org.netbeans.modules.form.FormDesigner.align(FormDesigner.java:1287)
This issue has already 20 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=45210
Build: NetBeans IDE Dev (Build 200905280001) VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03 OS: Linux, 2.6.28-12-generic, i386 User Comments: I have selected labels in the designer and clicked to align them on the right Stacktrace: java.lang.AssertionError at org.netbeans.modules.form.layoutdesign.LayoutInterval.getCurrentSpace(LayoutInterval.java:500) at org.netbeans.modules.form.layoutdesign.LayoutAligner.getPosition(LayoutAligner.java:510) at org.netbeans.modules.form.layoutdesign.LayoutAligner.splitByAlignAttrs(LayoutAligner.java:311) at org.netbeans.modules.form.layoutdesign.LayoutAligner.alignIntervals(LayoutAligner.java:90) at org.netbeans.modules.form.layoutdesign.LayoutDesigner.align(LayoutDesigner.java:2916) at org.netbeans.modules.form.FormDesigner.align(FormDesigner.java:1287)
Created attachment 83040 [details] stacktrace
Created attachment 83041 [details] form file
Created attachment 83042 [details] java file: select all labels in the left "column" and align them to by the right edge
*** Bug 87255 has been marked as a duplicate of this bug. ***
Still valid Product Version: NetBeans IDE Dev (Build 201110030601) Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b17 System: Linux version 2.6.38-11-generic running on i386; UTF-8; en_US (nb)
*** Bug 107522 has been marked as a duplicate of this bug. ***
*** Bug 118161 has been marked as a duplicate of this bug. ***
Created attachment 125626 [details] stacktrace I set Align Left in Gui Builder for Swing objects.
Created attachment 154975 [details] stacktrace Attempting to layout visual components