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.
I have found a repeatable problem with the the UI editor. Occassionally the setBounds method for components nested within a JLayeredPane gets set to garbage i.e. Assume we have a JPanel with a nested JLayeredPane with a nested JLabel (loginBackgroundImageLabel) then loginBackgroundImageLabel.setBounds gets changed -> From: loginBackgroundImageLabel.setBounds(0, 60, 1004, 628); To: loginBackgroundImageLabel.setBounds(0, 60, -1, -1); To reset the method I do the following: 1) Right click on the JLayeredPane object (aJLayeredPane) in the "Inspector" window and select copy 2) Right click on the top level JPanel object in the "Inspector" window and select paste to get a new JLayeredPane (aJLayeredPane1) 3) Right click on the original JLayeredPane object (aJLayeredPane) in the "Inspector" window and select delete 4) Rebuild and all the setBounds methods for all components nested withing the new object aJLayeredPane1 are now reset to their proper values
Created attachment 29743 [details] Java & Form files corrupted by UI editor and then fixed
Created attachment 29745 [details] previous attachment contains garbage
In fact I find that I can when I have the corrupted .form I can force the setBounds methods to correct themselves if for each component nested in the LayeredPane I manuall change the "Width" & "Height" properties in the "Layout" section of the property editor from "Preferred" to the actual value I want. This causes "basicHeaderComponent.setBounds(0, 0, -1, -1);" to change to "basicHeaderComponent.setBounds(0, 0, 1004, 50);". So I guess this problem is associated with some problem with the calculation of "Preferred" values associated with laying out the components in a LayeredPane. I did try "touching" the form file to force a recalculation but this didn't work even when I manually deleted the classes and jar and restarted the application. It is all very strange coz the only difference between the attached form files is an ordering of the attributes in the XML sections associated with the nested components of the JLayeredPane.
*** This issue has been marked as a duplicate of 82583 ***