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.
Build: NetBeans IDE 6.0 Beta 1 (Build 200709070000) VM: Java HotSpot(TM) Client VM, 1.5.0_12-b04 OS: Linux, 2.6.21-suspend2-r4, i386 User Comments: While using java.awt.Frame form designer I added a java.awt.Panel and tried to set its layout to the BorderLayout.
Created attachment 48735 [details] stacktrace
tested on build 070913 and it doesn't happened Can you reproduce this issue? For this time I assign keyword RANDOM for this bug..
It happened to me once, after reporting and restart of IDE I tried to do it once more and it was OK then.
Wasn't there an exception before this one? Just after adding the panel? Don't you have it still in the log by chance?
Created attachment 48763 [details] Messages.log
Tomasi, I've attached the messages log I've found, hopefully it the correct one.
The following exception seems to be the culprit: java.lang.NullPointerException at sun.awt.X11.XWindow.getParentWindow(XWindow.java:221) at sun.awt.X11.XWindow.<init>(XWindow.java:110) at sun.awt.X11.XComponentPeer.<init>(XComponentPeer.java:148) at sun.awt.X11.XLabelPeer.<init>(XLabelPeer.java:45) at sun.awt.X11.XToolkit.createLabel(XToolkit.java:623) at java.awt.Label.addNotify(Label.java:171) at java.awt.Container.addImpl(Container.java:1052) at java.awt.Container.add(Container.java:390) at org.netbeans.modules.form.layoutsupport.AbstractLayoutSupport.addComponentsToContainer(AbstractLayoutSupport.java:568) at org.netbeans.modules.form.layoutsupport.LayoutSupportManager.fillLayout(LayoutSupportManager.java:373) at org.netbeans.modules.form.layoutsupport.LayoutSupportManager.setLayoutDelegate(LayoutSupportManager.java:204) at org.netbeans.modules.form.RADVisualContainer.setLayoutSupportDelegate(RADVisualContainer.java:88) at org.netbeans.modules.form.FormModel.setContainerLayoutImpl(FormModel.java:426) at org.netbeans.modules.form.FormModel.setContainerLayout(FormModel.java:436) [catch] at org.netbeans.modules.form.MetaComponentCreator.setContainerLayout(MetaComponentCreator.java:948) at org.netbeans.modules.form.MetaComponentCreator.createAndAddComponent2(MetaComponentCreator.java:326) at org.netbeans.modules.form.MetaComponentCreator.access$300(MetaComponentCreator.java:62) at org.netbeans.modules.form.MetaComponentCreator$3.run(MetaComponentCreator.java:306) at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:210) at org.openide.util.Mutex.doEventAccess(Mutex.java:1201) at org.openide.util.Mutex.readAccess(Mutex.java:262) at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:195) at org.netbeans.modules.form.MetaComponentCreator.createAndAddComponent(MetaComponentCreator.java:303) at org.netbeans.modules.form.MetaComponentCreator.createComponent(MetaComponentCreator.java:96) at org.netbeans.modules.form.actions.SelectLayoutAction$LayoutActionListener.actionPerformed(SelectLayoutAction.java:216) ... Failed to initialize layout java.awt.FlowLayout. The layout cannot be set.SEVERE [global] This means there was a failure setting FlowLayout to a container that already contained java.awt.Label. Before that the container must have "Free Design" set - the failure returned the original layout delegate which was null - and this null caused all the other exceptions. Looks like some problem with replacing the native peers in AWT components, but probably hard to fix if not able to reproduce. Also might be Linux specific.
Tried to reproduce various possible scenarios on XP and Linux - with no luck. If we find steps to reproduce we'll fix in the future. Given the sporadic occurrence and that it only with AWT, I'm lowering the priority.
Created attachment 48959 [details] Messages log from IDE
It happened to me once more and caused a data loss, because I wasn't able to save the changes I did. So think that the priority is P2. I've attached the messages log from IDE from last occurrence. BTW: the AWT is required while you like to create an application for mobile devices, so it is used often.
I've made a fix which should try to recover from the first exception not to cause the later problems. Still don't know how the original exception could happen - tried another fix here, but not sure if it helps. We'll see. /cvs/form/src/org/netbeans/modules/form/FormModel.java new revision: 1.79; previous revision: 1.78 /cvs/form/src/org/netbeans/modules/form/layoutsupport/LayoutSupportManager.java new revision: 1.42; previous revision: 1.41