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 191744 - Auto-resize broken for buttons with no vertical space around them
Summary: Auto-resize broken for buttons with no vertical space around them
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Natural Layout (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks: 136425
  Show dependency tree
 
Reported: 2010-11-08 20:59 UTC by swpalmer
Modified: 2011-10-14 15:06 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description swpalmer 2010-11-08 20:59:13 UTC
Product Version = NetBeans IDE Dev (Build 201011070000)
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.6.0_22
Runtime = Java HotSpot(TM) Client VM 17.1-b03

To reproduce:

- Create a new JPanel form
- add three JButtons from left to right
- Resize all three buttons so there is no gap between the top and bottom of the buttons and the edge of the form (you will already have to fight the GUI builder to do this, as it will move things around in undesireable ways as you edit are adjusting the layout)
-select all three buttons and set them to auto-resize vertical.
-test the form - the buttons do not resize.

Workaround - you MUST leave a gap at the bottom of the buttons for the auto-resize to work.

In NB 6.9.1 I could wrestle the GUI editor to make this work.. in 7.0 I can't get it to work.
Comment 1 swpalmer 2010-11-08 21:02:16 UTC
I found a way to get it to work...  leave a gap at the bottom of all three buttons, pick the middle button and "adjust space around component", set bottom amount to 0. All three buttons will snap to the bottom edge and the resize attribute willstick.. just don't touch it after that!
Comment 2 MackSix 2011-10-12 17:50:42 UTC
You have to struggle because adding the three buttons automatically centers the vertically. If you highlight the three buttons and click "Align top in row" button on the Designer toolbar, it makes it easy to snap to the top of the panel and then vertically resize them down and snap to the bottom of the panel.

The auto-resize works in Product Version: NetBeans IDE Dev (Build 201110120600) with or without space at the top or bottom of them, so this issue is not an issue any longer. 

I am marking this as resolved.
Comment 3 MackSix 2011-10-12 18:05:34 UTC
This also works in Product Version: NetBeans IDE 7.0.1 (Build 201107282000) if non-Dev version is desired.
Comment 4 Tomas Pavek 2011-10-13 09:58:10 UTC
The baseline alignment stays in the way when resizing vertically. It should be canceled when snapping to something else (like the container border in this case). I've fixed it so this use case can be done directly without the workaround of top-aligning the buttons first.

http://hg.netbeans.org/jet-main/rev/624bc4de9c05
Comment 5 Quality Engineering 2011-10-14 15:06:18 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/624bc4de9c05
User: Tomas Pavek <tpavek@netbeans.org>
Log: #191744: baseline resizing tweaks