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 171427

Summary: NullPointerException at org.netbeans.modules.form.layoutdesign.LayoutPersistenceManager.saveLayout
Product: guibuilder Reporter: alied <alied>
Component: Natural LayoutAssignee: issues@guibuilder <issues>
Status: RESOLVED INCOMPLETE    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
URL: http://statistics.netbeans.org/exceptions/detail.do?id=22636
Issue Type: DEFECT Exception Reporter: 22636
Attachments: stacktrace

Description alied 2009-09-03 18:15:32 UTC
Build: NetBeans IDE Dev (Build nbms-and-javadoc-3856-on-090902)
VM: Java HotSpot(TM) Client VM, 16.0-b03, Java(TM) SE Runtime Environment, 1.7.0-ea-b59
OS: Windows Vista, 6.0, x86

User Comments:
alied: after saving JDialog Form

GUEST: Changing the variable Name of a JMenuBar inside NetBeans GUI Editor

GUEST: Changing the variable name of a Panel in the NetBeans GUI Editor

GUEST: This is the second time in a row I have encountered this problem (I restarted NetBeans between occurrences).  Here is more detail:
1. My project contained a second JFrame, with a JPanel inside of that, and several labels, text boxes and buttons inside of that.
2. I decided that instead of the 2nd JFrame, what I really needed was a modal dialog, so I created a JDialog component.
3. I renamed the JDialog component's variable name to something more sensible for my application.
4. In the design view, I dragged the components from the old JFrame into my new JDialog one by one using the component tree control in the middle left of the screen (default configs)
5. I switched to Source view to switch some references in code from the JFrame to the JDialog.
6. I tried to save by pressing ctrl-S.  No luck.
7. I tried to save by pressing the save button.  Still no luck.
8. I tried to save ty closing the source file, hoping to take advantage of the "do you want to save?" dialog.  At this point I not

GUEST: replacing a JFrame with a JDialog, and fixing references to the old component.  my control key had stopped working in netbeans slightly before this crash.



Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.form.layoutdesign.LayoutPersistenceManager.saveLayout(LayoutPersistenceManager.java:155)
        at org.netbeans.modules.form.layoutdesign.LayoutPersistenceManager.saveContainer(LayoutPersistenceManager.java:135)
        at org.netbeans.modules.form.layoutdesign.LayoutModel.saveContainerLayout(LayoutModel.java:1062)
        at org.netbeans.modules.form.GandalfPersistenceManager.saveLayout(GandalfPersistenceManager.java:3304)
        at org.netbeans.modules.form.GandalfPersistenceManager.saveContainer(GandalfPersistenceManager.java:3258)
        at org.netbeans.modules.form.GandalfPersistenceManager.saveAnyComponent(GandalfPersistenceManager.java:3231)
Comment 1 alied 2009-09-03 18:15:45 UTC
Created attachment 87074 [details]
stacktrace
Comment 2 Jan Stola 2009-09-10 16:01:14 UTC
I can imagine how this issue is annoying. Unfortunately, I am not able to reproduce this issue and the attached stack-
trace is not sufficient to track this problem down. It would be great to have a reproducible test-case. It would be 
ideal to have the problematic form (both .java and .form files) and exact steps that lead to the described problem.