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 211888

Summary: JFrame in Designer View Changes Size When Moved to Another Package
Product: guibuilder Reporter: MackSix
Component: Natural LayoutAssignee: issues@guibuilder <issues>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 7.2   
Hardware: PC   
OS: Windows Vista   
Issue Type: DEFECT Exception Reporter:
Attachments: Project to use for reproduction.
Before Screenshot
After Screenshot

Description MackSix 2012-04-30 23:01:02 UTC
Created attachment 118908 [details]
Project to use for reproduction.

JFrame in Designer view changes size when moved to another package.

1) Open Attached Project.
2) Open NewJFrame.java in Designer.
3) Move NewJFrame.java to "newpackage" with refactoring.
4) JFrame in Designer view gets shorter and lower edge covers lower label a bit. (See attached before and after screenshots.)

Product Version: NetBeans IDE Dev (Build 201204270400)
Java: 1.7.0_04; Java HotSpot(TM) Client VM 23.0-b21
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
Comment 1 MackSix 2012-04-30 23:01:35 UTC
Created attachment 118909 [details]
Before Screenshot
Comment 2 MackSix 2012-04-30 23:01:58 UTC
Created attachment 118910 [details]
After Screenshot
Comment 3 Tomas Pavek 2012-05-11 14:10:55 UTC
It's not related to moving, it's enough to reopen the form.

The problem seems to be in that the text of one property is set via binding, which happens later after the label is added to the container. GroupLayout for some reason keeps considering the original zero size of the label as seen first time and so returns smaller overall size when later asked for preferred size of the container. So it's only an incorrect initial size of the designer.

Fixed: http://hg.netbeans.org/jet-main/rev/84e17d963fde
Comment 4 Quality Engineering 2012-05-12 09:59:45 UTC
Integrated into 'main-golden', will be available in build *201205120400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/84e17d963fde
User: Tomas Pavek <tpavek@netbeans.org>
Log: #211888: property set to cloned object from binding is set later and if it affects component size, GroupLayout may not consider the change