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 128977

Summary: NullPointerException when setting Align: Top to Row
Product: guibuilder Reporter: kate <kate>
Component: CodeAssignee: issues@guibuilder <issues>
Status: NEW ---    
Severity: blocker CC: aldo, asenk, exlons, FiruzzZ, MackSix, scanti
Priority: P3    
Version: 6.x   
Hardware: All   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: scr1.jpg
stacktrace
Project that exhibited the error before saved.
New Project that exhibits the error.
stacktrace
asenk project
asenk
stacktrace

Description kate 2008-03-03 09:46:25 UTC
Product Version: NetBeans IDE Dev (Build 200803021202)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)

Description
===========

1. New Java Application -> add new JFrame
2. Place JTabbedPane to JFrame as displayed in scr.jpg
3. Place JTextArea to JFrame as displayed in scr.jpg
4. Place JButton to JFrame as displayed in scr.jpg
5. In Designer Window select both components JTextArea and JButton
6. Invoke popup menu and select Align -> Top Bottom

NullPointer Exception is raised.
Comment 1 kate 2008-03-03 09:47:21 UTC
Created attachment 57651 [details]
scr1.jpg
Comment 2 kate 2008-03-03 09:50:36 UTC
Stack Trace
-----------

java.lang.NullPointerException
	at org.netbeans.modules.form.layoutdesign.LayoutInterval.getEffectiveAlignment(LayoutInterval.java:966)
	at org.netbeans.modules.form.layoutdesign.LayoutAligner.splitByAlignAttrs(LayoutAligner.java:350)
	at org.netbeans.modules.form.layoutdesign.LayoutAligner.splitByAlignAttrs(LayoutAligner.java:208)
	at org.netbeans.modules.form.layoutdesign.LayoutAligner.splitByAlignAttrs(LayoutAligner.java:208)
	at org.netbeans.modules.form.layoutdesign.LayoutAligner.alignIntervals(LayoutAligner.java:90)
	at org.netbeans.modules.form.layoutdesign.LayoutDesigner.align(LayoutDesigner.java:2835)
	at org.netbeans.modules.form.FormDesigner.align(FormDesigner.java:1272)
	at org.netbeans.modules.form.FormDesigner$AlignAction.actionPerformed(FormDesigner.java:2433)
	at org.netbeans.modules.form.actions.AlignAction$AlignMenuItemListener.actionPerformed(AlignAction.java:237)
Comment 3 Jan Stola 2008-03-03 15:47:41 UTC
Reproducible. On the other hand, this use-case doesn't have much sense => lowering priority.
Comment 4 Jan Stola 2008-07-04 12:44:06 UTC
*** Issue 138959 has been marked as a duplicate of this issue. ***
Comment 5 Exceptions Reporter 2010-07-01 19:05:18 UTC
Created attachment 100550 [details]
stacktrace
Comment 6 Jan Stola 2011-08-29 12:34:39 UTC
*** Bug 201381 has been marked as a duplicate of this bug. ***
Comment 7 MackSix 2011-10-07 16:05:52 UTC
I can't reproduce this using the test case described by the original reporter.

I do have another test case that caused this exception, but the project that I saved changes configuration when opened in NetBeans. One of the components jumps out of positions when opened.

See http://statistics.netbeans.org/analytics/exception.do?id=531727

I will upload the configuration since it might be useful to look at.

Product Version: NetBeans IDE Dev (Build 201110050601)
Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b17
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
Comment 8 MackSix 2011-10-07 16:12:27 UTC
Created attachment 111662 [details]
Project that exhibited the error before saved.

jPanel5 was lower in the mirrored position from jPanel4 aligned with jPanel2 and jPanel3 out edges.

If you open this project and then open NewJFrame.java, you may be able to see jPanel5 jump from where it was when I saved the file to the current position.

Before saving and when jPanel5 was in the right location, this error was thrown whenever I tried to use "Align top in row" button.
Comment 9 MackSix 2011-10-07 16:15:27 UTC
That is, when I only highlighted jPanel1, jPanel2 & jPanel3 and tried to use "Align top in row" button.
Comment 10 MackSix 2011-10-13 23:37:23 UTC
Created attachment 112030 [details]
New Project that exhibits the error.

1) Open attached project.
2) Open NewJFrame.java
3) Highlight panel2, choice1, button4, textField4, textArea2, scrollbar3.
4) Click "Align top in row" on Designer toolbar.

This NullPointerException occurs.

Product Version: NetBeans IDE Dev (Build 201110120600)
Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b17
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
Comment 11 Exceptions Reporter 2011-10-15 21:05:40 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=72033
Comment 12 asenk 2011-10-20 09:08:55 UTC
Created attachment 112249 [details]
stacktrace

1. In NewJframe.java in Designer select jButton2 an jLabel1
2. Click on Align top in row
Comment 13 asenk 2011-10-20 09:09:51 UTC
Created attachment 112250 [details]
asenk project
Comment 14 MackSix 2011-10-20 14:42:57 UTC
(In reply to comment #13)
> Created an attachment (id=112250) [details]
> asenk project

There is no components on the JFrame.
Comment 15 asenk 2011-10-20 15:07:15 UTC
Created attachment 112271 [details]
asenk
Comment 16 asenk 2011-10-20 15:08:25 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > Created an attachment (id=112250) [details] [details]
> > asenk project
> 
> There is no components on the JFrame.

Thanks, it was my mistake. I uploaded new project.
Comment 17 MackSix 2012-05-30 19:23:46 UTC
Created attachment 120085 [details]
stacktrace

Top align jRadioButton and 2 jCheckbox.