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.
[ BUILD # : 201205030400 ] [ JDK VERSION : 1.7.4 ] I will attach a sample form and the steps to reproduce it soon.
Reproducible with build Build 20120508-bc77094b1af6.
Created attachment 119223 [details] Sample project Just open the NB71.java form at 7.1 and 7.2 to see the difference. There is a gap at 7.2 which is not present at 7.1. Even the preview works differently.
Created attachment 119226 [details] Sample project with reproducible use case This reproducible case explains some issues I was facing and wasn't able to reproduce easily. To reproduce the problem: 1. Open the ReproducibleForm.java; 2. Select buttons 1, 2, 3, 4 and the table (in this specific order); 3. Right click at the selection, Align > Center to Column. It is reproducible in both IDEs, if you try this at 7.1, it is shown correctly on 7.1 but wrong at 7.2, and if you do this directly in 7.2 you can see the error right away.
In fact the current NetBeans version shows the "NB71" form correctly, i.e. with the resizing gaps next to the table and the panel, that's what is in the form file. The reason why it seems correct in NB 7.1 is due to a workaround of a specific bug in GroupLayout that affects some layouts with a resizing gap at the container border. This workaround changes the resizing gap to fixed when it builds the design view or when it generates code, not to let GroupLayout screw up the layout. The form given here looks correct because you'd really want fixed gaps there. But there are resizing gaps in the form, which NB 7.2 presents correctly, because we fixed the detection of the GroupLayout bug situation - in 7.1 the workaround was applied under broader conditions than necessary. (The form in this issue does not expose the bug, so the workaround was applied incorrectly.) So NB 7.2 shows the truth here. I don't think we should change it back, this would prevent many valid layouts to be built/generated correctly. The bug is in NB 7.1. You can easily fix the form in 7.2 by making the gaps really fixed: doubleclick the gap next to the table and uncheck the "Resizable" checkbox. Same with the gap next to the panel. As for the ReproducibleForm and the steps, this shows that the Align Center action is buggy, as it produces the unwanted resizing gap at the right (it is wrong because the table is already resizing). NB 7.1 just hid this bug. So we can keep this as a report of a bug in center aligning.
I agree with you, it really seems to be a bug at 7.1. Since the issue's summary is generic, I think we don't need to change it to track the align issue. Thanks Tomas for the evaluation.
Two problems with the aligning action when centering a sequence of fixed components with a large resizable component in parallel: 1) The size of the resizable component is adjusted to the sequence of components (if they occupy smaller space). 2) A resizing gap is created next to the group which already is resizing.