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 Dev (Build 201110030601) VM: Java HotSpot(TM) 64-Bit Server VM, 20.2-b06, Java(TM) SE Runtime Environment, 1.6.0_27-b07 OS: Windows 7 User Comments: sunbiz: Press Undo on the Customize Layout for GridBagLayout designer Stacktrace: java.lang.ClassCastException: javax.swing.GroupLayout cannot be cast to java.awt.GridBagLayout at org.netbeans.modules.form.layoutsupport.griddesigner.GridBagInfoProvider.getLayout(GridBagInfoProvider.java:139) at org.netbeans.modules.form.layoutsupport.griddesigner.GridBagInfoProvider.getY(GridBagInfoProvider.java:279) at org.netbeans.modules.form.layoutsupport.griddesigner.GlassPane.findColumnHeader(GlassPane.java:1015) at org.netbeans.modules.form.layoutsupport.griddesigner.GlassPane.updateActiveHeaders(GlassPane.java:442) at org.netbeans.modules.form.layoutsupport.griddesigner.GlassPane$Listener.mouseMoved(GlassPane.java:1368) at java.awt.Component.processMouseMotionEvent(Component.java:6333)
Created attachment 111694 [details] stacktrace
I am sorry, I am not able to reproduce this issue and the attached stack-trace is not sufficient to track the problem down. It is not clear to me how to get into the state where undo would result in the mentioned problem. Are you still able to reproduce this issue? If so, could you, please, provide more details? It would be great to see exact steps to reproduce. I also saw (in the uploaded message.log) other exceptions thrown shortly before the mentioned one. So, the original exception is probably java.lang.AssertionError at org.netbeans.modules.form.layoutsupport.griddesigner.GridDesigner$4. actionPerformed(GridDesigner.java:383) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) ... but even for this exception I need to know steps to reproduce.
Steps to reproduce: 1.) Create the samples GUI Form example project 2.) Open Antenna.java 3.) Right-click to setLayout and make it GridBag Layout 4.) Customize layout 5.) Press Disable uniform gaps. do not upgrade, press cancel 6.) Now press the Undo icon and you will see the exception.
For the other exception that you mention: java.lang.AssertionError at org.netbeans.modules.form.layoutsupport.griddesigner.GridDesigner$4. actionPerformed(GridDesigner.java:383) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) ... look at issue: http://netbeans.org/bugzilla/show_bug.cgi?id=201786
Thank you for the additional information. > 5.) Press Disable uniform gaps. do not upgrade, press cancel > 6.) Now press the Undo icon and you will see the exception. These steps show the root of the problem. When you press Cancel then the change in gaps is undone automatically. Unfortunately, undo/redo support used in the customizer misinterprets this automatic undo and considers it to be a regular change. In other words, Undo action shouldn't be enabled after step 5. (because no change has been done in the customizer yet). I have fixed the mentioned problem. Modified files: http://hg.netbeans.org/jet-main/rev/216e0dc0a655