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 197740 - Grid Bag Layout Customizer in 7.0 rc2 Zero Size Component
Summary: Grid Bag Layout Customizer in 7.0 rc2 Zero Size Component
Status: VERIFIED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.0
Hardware: All All
: P2 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
: 197732 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-04-14 12:33 UTC by honza.hubeny
Modified: 2011-07-25 09:02 UTC (History)
0 users

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 honza.hubeny 2011-04-14 12:33:40 UTC
When a component in grid bag layout has zero size (e.g. jLabel with empty
text, empty jPanel...), you cannot select this component in the 7.0 grid bag
layout customizer. (This empty components are used as a spacer with nonzero
weight  in many applications)
Comment 1 Marian Mirilovic 2011-04-14 13:51:00 UTC
*** Bug 197732 has been marked as a duplicate of this bug. ***
Comment 2 Jan Stola 2011-04-20 11:58:14 UTC
This problem is caused by the fact that the new customizer (contrary to the old one is more-or-less WYSIWYG). Hence, the zero-sized components have really zero size and as such cannot be selected.

On the other hand, the designer was implemented with spacer components in mind. They were even added into the Palette into Swing Fillers category. The components in this category are based on Box.Filler and the new grid-designer recognizes them and pads them artificially to make their size non-zero (hence, allowing their selection).

You are right that many users still abuse components like empty JPanel or JLabel without text to implement spacers. We should extend the hacks that we use for Box.Filler currently to cover also these scenarios.
Comment 3 Jan Stola 2011-04-20 16:27:04 UTC
Fixed. The mentioned hack has been extended to other (non Box.Filler) components as well. The width/height of zero-size components is padded to 2. It is hard to select such components directly (i.e., using single click). The best approach is to use Marquee selection (i.e., mouse press, drag and "paint" the selection rectangle, mouse release). The Marquee selection may select also some adjacent (positive-size) components, but it is easy to remove them from multi-selection using Ctrl+click.

Modified file: http://hg.netbeans.org/jet-main/rev/81352f62df06
Comment 4 Quality Engineering 2011-05-13 05:47:48 UTC
Integrated into 'main-golden', will be available in build *201105130000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/44c10689104a
User: Petr Somol <psomol@netbeans.org>
Log: #197740 Follow-up; Enlarged Zero Size component to enable direct selection by mouse click in GridBagLayout customizer