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 74762 - setBounds JLayeredPane
Summary: setBounds JLayeredPane
Status: RESOLVED DUPLICATE of bug 82583
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-11 06:28 UTC by cjptopher
Modified: 2006-09-05 10:25 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Java & Form files corrupted by UI editor and then fixed (40.00 KB, application/x-tar)
2006-04-11 06:34 UTC, cjptopher
Details
previous attachment contains garbage (30.00 KB, application/x-tar)
2006-04-11 06:52 UTC, cjptopher
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cjptopher 2006-04-11 06:28:42 UTC
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
Comment 1 cjptopher 2006-04-11 06:34:19 UTC
Created attachment 29743 [details]
Java & Form files corrupted by UI editor and then fixed
Comment 2 cjptopher 2006-04-11 06:52:58 UTC
Created attachment 29745 [details]
previous attachment contains garbage
Comment 3 cjptopher 2006-04-11 07:07:23 UTC
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.
 
Comment 4 Jan Stola 2006-09-05 10:25:17 UTC

*** This issue has been marked as a duplicate of 82583 ***