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 201109060600) VM: Java HotSpot(TM) 64-Bit Server VM, 20.1-b02, Java(TM) SE Runtime Environment, 1.6.0_26-b03 OS: Windows 7 User Comments: sunbiz: Pressed on Upgrade in the Grid bag layout designer while was pressing the Undo button to change, got this exception Stacktrace: java.lang.AssertionError at org.netbeans.modules.form.layoutsupport.griddesigner.GridDesigner$3.actionPerformed(GridDesigner.java:365) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:291) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
Created attachment 110507 [details] stacktrace
Steps to reproduce: 1. Create a new JPanel. 2. Set its layout to GridBagLayout. 3. Invoke Customize Layout... action from the context menu of the panel. => grid designer is shown. 4. Press 'Enable uniform gaps' button in grid designer's toolbar. 5. Press 'Undo' button in grid designer's toolbar. 6. Press 'Enable uniform gaps' button in grid designer's toolbar again. => the mentioned exception is thrown.
I don't want to fill a new bug, because I think this problem is related. If I follow Jans steps, one problem is this exception. The second problem is that in the end there is twice more columns and rows. Using undo or redo again doesn't help.
Created attachment 110887 [details] stacktrace 1.) New CDC Application 2.) New CrEme JFrame Form 3.) Right-click on the JFrame -> Set Layout -> Gridbag Layout 4.) Customize Layout 5.) Click on Enable Uniform Gaps 6.) GUI Form Form Upgrade request window comes up. Press Cancel. 7.) Click the Enable Uniform Gaps toggle again... and this exception is thrown
fixed in jet-main http://hg.netbeans.org/jet-main/rev/d91a554b464f
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/d91a554b464f User: Petr Somol <psomol@netbeans.org> Log: #201786 - [71cat] AssertionError at form.layoutsupport.griddesigner.GridDesigner$3.actionPerformed
> fixed in jet-main > http://hg.netbeans.org/jet-main/rev/d91a554b464f The fix of this issue is incorrect. The part that adds listener support to UndoRedoSupport should be removed. You shouldn't observe undo/redo actions, you should observe the model properties that affect the state of the gap button, i.e., columnWidths and rowHeights properties. The following test-case shows where the mentioned "fix" fails 1. Create Samples > Java > GUI Form Examples project 2. Open Antenna.java 3. Set layout of the root container (JFrame) to Grid Bag Layout. 4. Invoke Cutomize Layout ... action on the root container. 5. Press Enable Uniform Gaps button. => Upgrade dialog is shown. 6. Press Cancel in the dialog. 7. Press Disable Uniform Gaps button => the exception is thrown Your fix fails here because the model properties are not modified through the undo/redo actions that you are observing.
*** Bug 203770 has been marked as a duplicate of this bug. ***
Jan, thank you for identifying the problem with listening on Undo/Redo. Fixed in jet-main: http://hg.netbeans.org/jet-main/rev/1a0ec4409e0f
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/1a0ec4409e0f User: Petr Somol <psomol@netbeans.org> Log: #201786 - (fix correction) AssertionError at form.layoutsupport.griddesigner.GridDesigner$3.actionPerformed