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 85259 - LAYOUT: Exception during resizing of frame with panels
Summary: LAYOUT: Exception during resizing of frame with panels
Status: RESOLVED DUPLICATE of bug 94605
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Natural Layout (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-19 18:55 UTC by Jana Maleckova
Modified: 2010-08-20 12:20 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
form (4.30 KB, text/xml)
2006-09-19 18:57 UTC, Jana Maleckova
Details
java (4.89 KB, text/plain)
2006-09-19 18:57 UTC, Jana Maleckova
Details
StackTrace (1.92 KB, text/plain)
2006-09-19 18:58 UTC, Jana Maleckova
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jana Maleckova 2006-09-19 18:55:33 UTC
NetBeans IDE Dev (Build 200609171800)
1.6.0-rc; Java HotSpot(TM) Client VM 1.6.0-rc-b98
Windows XP version 5.1 running on x86
cs_CZ (nb); Cp1250

Description:
============
In attachment there is form file. Add this form to your project and in design
mode, take right margin in mouse and try to resize it in direction to the left.
Then an exception will occure.

I found method how to create this issue but I am not sure if it will appear in
every case. That why I enclosed form file.
1) create JFrame and insert two JPanels into it
2)these two panels should cut frame in two parts (north and sourth part)
First one should be extended to span between the container's left and right
margins in accordance with the recommended offset.
The second one is added in the same way but under the first one (you can see
form in attachment). 
3) Select both JPanels and check attribute Horizonatal Resizable.
Buttons "Change horizontaly and verticaly resizability" should not be pushed
4) add JLabel and JTextField into the first Panel. Swings should be in the same
horizontal group with preffered gap between them. JLabel will be placed in the
left corner. The JTextField's right edge snaps into alignment with the JPanel's
recommended edge margin.
5) then insert JButton into the right corner of first JPanel. Then JFrame
becomes wider.
6) Use undo button.
7) Then put the right margin of JFrame in mouse and try to resize it in left
direction. Make it smaller. Then exception will occure.

So first issue is thrown exception
The second one is that undo didn't work correctly. JButton disappeared but the
size of the frame didn't return back.

StackTrace:
===========
java.lang.AssertionError
	at
org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.convertSize(SwingLayoutBuilder.java:297)
	at
org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.fillGroup(SwingLayoutBuilder.java:201)
	at
org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.composeGroup(SwingLayoutBuilder.java:172)
Comment 1 Jana Maleckova 2006-09-19 18:57:37 UTC
Created attachment 34177 [details]
form
Comment 2 Jana Maleckova 2006-09-19 18:57:55 UTC
Created attachment 34178 [details]
java
Comment 3 Jana Maleckova 2006-09-19 18:58:27 UTC
Created attachment 34179 [details]
StackTrace
Comment 4 Tomas Pavek 2010-08-20 11:44:12 UTC
The exception is not thrown anymore.

The undo of designer size does not work due to rather special conditions: the two panels are placed in a group with suppressed resizing, which does not allow shrinking. After undo the model is correct, but jPanel2 that grew after adding the button next to jPanel1 is not rebuilt after undo because there is no event for updating just the empty space size. There is attempt to return back the designer size, but the not-updated jPanel2 prevents that.
Comment 5 Tomas Pavek 2010-08-20 12:20:45 UTC
The undo problem is analogical to bug 94605.

*** This bug has been marked as a duplicate of bug 94605 ***