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.

Bug 91892 - LAYOUT: Align components into column left
Summary: LAYOUT: Align components into column left
Status: NEW
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Natural Layout (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P3 blocker with 1 vote (vote)
Assignee: issues@guibuilder
URL:
Keywords:
: 87255 107522 118161 132437 141695 (view as bug list)
Depends on:
Blocks: 136425
  Show dependency tree
 
Reported: 2007-01-05 13:59 UTC by Jiri Vagner
Modified: 2016-04-13 12:44 UTC (History)
19 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Layout 1 (2.76 KB, image/jpeg)
2007-01-05 14:01 UTC, Jiri Vagner
Details
Layout 2 (2.40 KB, image/jpeg)
2007-01-05 14:01 UTC, Jiri Vagner
Details
Exception (2.37 KB, text/plain)
2007-01-05 14:02 UTC, Jiri Vagner
Details
stack trace (4.54 KB, text/plain)
2008-04-28 11:25 UTC, Petr Dvorak
Details
stacktrace (2.79 KB, text/plain)
2009-05-31 23:07 UTC, Petr Dvorak
Details
form file (21.42 KB, text/plain)
2009-05-31 23:08 UTC, Petr Dvorak
Details
java file: select all labels in the left "column" and align them to by the right edge (15.73 KB, text/plain)
2009-05-31 23:10 UTC, Petr Dvorak
Details
stacktrace (3.36 KB, text/plain)
2012-10-09 12:02 UTC, mstarnacki
Details
stacktrace (3.36 KB, text/plain)
2015-07-28 13:59 UTC, bolsover
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Vagner 2007-01-05 13:59:48 UTC
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)
Comment 1 Jiri Vagner 2007-01-05 14:01:20 UTC
Created attachment 37072 [details]
Layout 1
Comment 2 Jiri Vagner 2007-01-05 14:01:43 UTC
Created attachment 37073 [details]
Layout 2
Comment 3 Jiri Vagner 2007-01-05 14:02:33 UTC
Created attachment 37074 [details]
Exception
Comment 4 Jan Stola 2007-01-08 10:51:37 UTC
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)
Comment 5 Petr Dvorak 2008-04-28 11:25:01 UTC
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)
Comment 6 Petr Dvorak 2008-04-28 11:25:26 UTC
Created attachment 60738 [details]
stack trace
Comment 7 Jan Stola 2008-05-28 16:38:54 UTC
*** Issue 132437 has been marked as a duplicate of this issue. ***
Comment 8 Jan Stola 2008-07-28 10:41:28 UTC
*** Issue 141695 has been marked as a duplicate of this issue. ***
Comment 9 Exceptions Reporter 2008-08-21 11:08:25 UTC
This issue has already 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=45210
Comment 10 dfriesen 2008-09-18 23:21:38 UTC
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)
Comment 11 Exceptions Reporter 2008-12-11 17:42:00 UTC
This issue has already 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=45210
Comment 12 Petr Dvorak 2009-05-31 23:06:51 UTC
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)
Comment 13 Petr Dvorak 2009-05-31 23:07:02 UTC
Created attachment 83040 [details]
stacktrace
Comment 14 Petr Dvorak 2009-05-31 23:08:44 UTC
Created attachment 83041 [details]
form file
Comment 15 Petr Dvorak 2009-05-31 23:10:09 UTC
Created attachment 83042 [details]
java file: select all labels in the left "column" and align them to by the right edge
Comment 16 Tomas Pavek 2010-08-20 12:03:18 UTC
*** Bug 87255 has been marked as a duplicate of this bug. ***
Comment 17 asenk 2011-10-04 08:50:21 UTC
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)
Comment 18 Tomas Pavek 2012-06-15 14:29:03 UTC
*** Bug 107522 has been marked as a duplicate of this bug. ***
Comment 19 Tomas Pavek 2012-06-15 15:45:08 UTC
*** Bug 118161 has been marked as a duplicate of this bug. ***
Comment 20 mstarnacki 2012-10-09 12:02:14 UTC
Created attachment 125626 [details]
stacktrace

I set Align Left in Gui Builder for Swing objects.
Comment 21 bolsover 2015-07-28 13:59:42 UTC
Created attachment 154975 [details]
stacktrace

Attempting to layout visual components