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.
Have a JFrame with a label whose width entirely fits inside the frame. Set the label's text property to a string longer than the frame width. The label will resize to fit the whole string, but it won't fit inside the frame anymore (being wider than the frame), and worse, it will cause other components in the frame to be resized this way too. See the attached images.
Created attachment 65112 [details] Initial state
Created attachment 65113 [details] Label incorrectly resized
Created attachment 65114 [details] Expected behavior
Created attachment 65115 [details] JFrame source code and .form file
I am sorry, I don't see any problem in GUI builder using your test case. The description shows that you designed the layout of your container in one way, but you want to behave it differently. The GUI builder cannot know that. You should change the layout to meet your needs. The label is added as non-resizable component e.g. component that keeps its preferred size and doesn't resize when the size of the container is changed. When you change the text of the label then its preferred size is changed (increased). Hence, the label becomes wider. The "expected behavior" screenshot shows that you want another behaviour. You want the text of your label to stop few pixels before the right edge of the container e.g. you want your label to be resizable. You don't want it to honor its preferred size. You can easily achieve that - just drag the right edge of the label and drop it aligned with the right edge of the JComboBox. Unfortunately, you have to do one more change. By default, we generate code that doesn't allow resizable labels to shrink below its minimum size (usually equal to preferred size) - while this is the required behaviour in most cases, it is not true in your case. So, the last change you have to do is to change the minimum size to (0,0). Now the layout should work as you expected.
Thank you for the explanation.