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 125080 - LAYOUT: Matisse shows snap-to guides when dragging, but snaps somewhere else when button is released
Summary: LAYOUT: Matisse shows snap-to guides when dragging, but snaps somewhere else ...
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 3 votes (vote)
Assignee: issues@guibuilder
Depends on:
Blocks: 136425
  Show dependency tree
Reported: 2008-01-11 01:43 UTC by swpalmer
Modified: 2011-10-04 10:54 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

Form file for examples (8.25 KB, text/plain)
2008-01-14 14:28 UTC, swpalmer
Java file to go with Form (6.59 KB, text/plain)
2008-01-14 14:30 UTC, swpalmer

Note You need to log in before you can comment on or make changes to this bug.
Description swpalmer 2008-01-11 01:43:59 UTC
When doing no trivial UIs with the Netbeans GUI builder (Matisse) guide lines are shown while dragging components to
place them on the form.  In some cases these lines show that an edge of the component being dragged will be aligned with
another edge on a component that is already placed on the form.  I have found that often the edge alignment shown during
a resizing drag is not what I get when I release the mouse button and drop the component edge.

This typically occurs near the right edge of the form, when I'm aligning the right edge of my component and the
guideline shown indicates that the component edge will be aligned with the right edge of a component above the the
component that I am adjusting.  This edge is significantly to the left of the container's right edge such that it is not
near any of the "snap to" points near the container edge.   Instead, when I release the edge, it snaps to a position far
to the right of where the guidelines indicated it would go.  I think it is snapping to one of the  positions near the
container's right edge instead of where the on-screen indicators showed it being aligned to.
Comment 1 Jan Stola 2008-01-11 09:46:52 UTC
Could you, please, provide some test-case (as simple as possible)? It would be ideal to attach .java and .form files 
(saved before the last step) and then describe what edge/component should be snapped where (screenshots are welcome). 
Thank you in advance.
Comment 2 swpalmer 2008-01-14 14:28:16 UTC
Created attachment 55033 [details]
Form file for examples
Comment 3 swpalmer 2008-01-14 14:30:23 UTC
Created attachment 55034 [details]
Java file to go with Form
Comment 4 swpalmer 2008-01-14 14:48:15 UTC
Ok..  have attached a .from and .java file and run through several of the Matisse bugs here:

Open the attached form in NB 6. (it should be placed in a packaged named "desktoptest")
It has a sub-pane; containg a label,  a label and a text field, a table, and two sets of buttons (A1-3, B1-2).
Before you touch anything note the gap between the two sets of buttons.  A1-A3 are and B1-B2 are in a column to the 
right of the table.  There is a large gap between the A buttons and the B buttons - this gap corresponds to the 
largest snap-to guideline shown by Matisse.

The right edge of the text field is aligned with the right edge of the sub-panel (Panel1).

Here are the many things that go wrong when editing this form:

1- Grab the right edge of the table.  Drag it slightly left so that it snaps to the second or third guideline from the 
buttons.  Release the mouse button and notice that it snaps right back to the first guideline from the buttons!

2- Now as a workaround move the right edge of the table far enough away from the buttons that now snap-to guide is 
shown.  It stays put when you release the mouse.  Then, select all of the buttons (As + Bs) as a group and drag them 
so that they drop on the thrid snap-to guide from the table edge.  Release the mouse.  Notice that the buttons snap to 
the correct position from the table BUT the gap between the A buttons and the B buttons has been removed!!  Can you 
feel the frustration? :-)

3 - Reset to the original form state.  Grab the edge of the sub panel and drag it to the right so that it snaps to the 
table's right edge, release the mouse.  The text field will also be moved - that's ok because it was aligned with the 
panel edge to begin with.  Now move the sub panel edge back to where it was.  The text field edge remains aligned with 
the table - ok not that big of a deal, it is now stuck to the table instead of the panel.  But now grab the right edge 
of the text field and line it back up with the right edge of the sub-panel. Release the mouse and notice that the 
right edge of the table has snapped up agains the buttons!!  Argh!

4 - Grab a new text filed from the palette and drop it between the existing text field and the table, exactly centered 
under the existing text field.  You should have a smaller JTextField centered under the first oine, between it and the 
table.  Now grab the right edge of the new text field and drop it when it snaps to the right edge of the text field 
above.  Instead of snapping to the edge of the text field above like the guideline was showing it snaps to the right 
edge of the form!!

I probably could find more.. but that should be enough for now.  There are clearly cases where Matisse is showing that 
it will do one thing and then doing something completely different when you "commit" (release the mouse).

Comment 5 Jan Stola 2008-01-23 16:08:09 UTC
Thank you very much for your precise description. I was able to reproduce all descibed problems.
Comment 6 swpalmer 2008-07-28 16:45:43 UTC
Just wondering if any progress is being made on this issue.   It is related to other issues I am having with the form
designer.  It seems that more often than not when I'm trying to align components, the form designer is moving the other
components (not the one I am resizing or moving)to radically different positions when I release the mouse.

Perhaps if this bug can't be fixed directly there could be some way to lock-down the other components during an
operation so the form designer is explicitly told that it is NOT ok to move anything other than the component being
manipulated by the user.

I spend most of my days trying to fix UIs mangled by the form designer when I attempt to add or reposition a component.
 You try to nudge one thing into the correct position and then everything pops out of place all over the form.  That is
the typical experience.  Often resulting in the form growing to a huge size because most of the components are displaced
to the right or downward and it is difficult to pull it back to the correct size because you must reposition most of
those components by hand before it will let you shrink the size of the form back to what it should be.
Comment 7 Tomas Pavek 2008-07-28 17:10:51 UTC
This issue is not just one fix, it requires more work, so it will take time. We may also consider something like 
the "lock" mode you suggested. We keep this report opened since you provided a nice reproducible test case. Thanks for 

In a shorter time we'd like to put together some tips and tricks that can make the layout design easier. For example, 
sometimes when the layout becomes complicated and it is hard to change it often helps to recreate it - and it is 
relatively easy, see
Comment 8 genamiga 2009-03-15 23:23:36 UTC
I have quite the same problem. It is a big lost of time dealing with those GUI builder problems...

When can we except a solution ?
Comment 9 genamiga 2009-09-30 07:49:53 UTC
I tried the tricks
...but if everythime I would like to move something I have to "rebuild" the form...we have to be serious, this is 
quite usuable... 

Now I am using 6.7.1 and problems are still there...

When can we except a solution ?
6.8 ?
Comment 10 genamiga 2009-10-01 12:21:55 UTC
I have the same problem from the begining...I am using Netbeans since version 6.0. 

Everytime there is a new realease I hope the bug is fixed but it is always there.  This is a major issue and I don't 
understand why there is no improvement and visible efforts (release changes) for fix it. 

Design form is extremely important... 

I am working on a big ERP project (at the end, hundreds of complex forms) and it is at lot of time wasted in dealing 
with those bugs. 

It will be great to have a "lock component" feature or disabling auto-aligment 

Please help... 

Other people are reporting those problems from years now... 

It will be very nice to have a reaction of a Netbeans developper about that major issue.  And to know what they are 
doing to fix that problem. 

I continue to find it sad that such an extremely powerful, amazingly diverse development system doesn't come up with a 
simple and reliable way to do layout. 
Comment 11 misterm 2010-05-05 13:05:41 UTC
The link to the tips and tricks which are supposed to help to workaround this issue no longer works:

Can someone from the NetBeans team provide an updated link? Adding the now unaccessible content to the wiki seems a better idea.
Comment 12 Jan Stola 2010-05-05 15:08:47 UTC
> Can someone from the NetBeans team provide an updated link?

It seems that the format of links to mailing list archives changed :-(. The correct link is below (I hope - I cannot verify where the original link pointed to).
Comment 13 asenk 2011-10-04 10:53:57 UTC
Fixed in 7.1 - Free Design improvements
Comment 14 asenk 2011-10-04 10:54:33 UTC
Product Version: NetBeans IDE Dev (Build 201110030601)
Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b17
System: Linux version 2.6.38-11-generic running on i386; UTF-8; en_US (nb)