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 95954 - LAYOUT: free design doesn't work well in cloned views
Summary: LAYOUT: free design doesn't work well in cloned views
Status: VERIFIED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Natural Layout (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: issues@guibuilder
URL:
Keywords:
: 143877 145009 190440 (view as bug list)
Depends on:
Blocks: 136425
  Show dependency tree
 
Reported: 2007-02-19 15:59 UTC by Jana Maleckova
Modified: 2011-10-04 10:09 UTC (History)
10 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 27135


Attachments
95954 (2.24 KB, text/plain)
2007-02-19 16:01 UTC, Jana Maleckova
Details
After I followed steps to reproduce (I dropped the second JButton in the Frame)... (2.86 KB, text/plain)
2008-04-28 11:53 UTC, Petr Dvorak
Details
After I closed the first exception and attempted to move the second button to another place in the form... (3.17 KB, text/plain)
2008-04-28 11:53 UTC, Petr Dvorak
Details
stacktrace (2.26 KB, text/plain)
2008-11-18 11:04 UTC, zolta
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jana Maleckova 2007-02-19 15:59:35 UTC
NetBeans IDE Dev (Build 200702182300)
1.6.0-rc; Java HotSpot(TM) Client VM 1.6.0-rc-b104
Windows XP version 5.1 running on x86
en_GB (nb); Cp1252

Description:
============
1. open jFrame in design
2. insert e.g. jButton
3. do clone document from context menu invoked on tab of your jFrame in design area
4. try to insert another component and align it vertically under your jButton.
You will see, form doesn't allow it. And when component is moved somewhere else
and then moved back under jButton, an exception occurs

StacktTrace:
============
java.lang.IllegalStateException: javax.swing.JButton ....is not attached to a
horizontal group
	at org.jdesktop.layout.GroupLayout.checkComponents(GroupLayout.java:986)
	at org.jdesktop.layout.GroupLayout.prepare(GroupLayout.java:940)
	at org.jdesktop.layout.GroupLayout.layoutContainer(GroupLayout.java:806)
	at
org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.createLayout(SwingLayoutBuilder.java:135)
Comment 1 Jana Maleckova 2007-02-19 16:01:27 UTC
Created attachment 38682 [details]
95954
Comment 2 Tomas Pavek 2007-02-20 10:22:53 UTC
Apparently free design doesn't work well in cloned views. Other layout managers 
seem to be fine.
Comment 3 Karthikeyan Rajeswaran 2007-04-14 20:21:01 UTC
This issue is possibly a duplicate of issue 91892 . As per 91892, the exception
happens even when document is not cloned.
Comment 4 Petr Dvorak 2008-04-28 11:52:11 UTC
Reproducible in NB 200804280002 (DEV), I got following exceptions.
Comment 5 Petr Dvorak 2008-04-28 11:53:04 UTC
Created attachment 60741 [details]
After I followed steps to reproduce (I dropped the second JButton in the Frame)...
Comment 6 Petr Dvorak 2008-04-28 11:53:55 UTC
Created attachment 60742 [details]
After I closed the first exception and attempted to move the second button to another place in the form...
Comment 7 Jan Stola 2008-08-14 09:46:55 UTC
*** Issue 143877 has been marked as a duplicate of this issue. ***
Comment 8 Petr Dvorak 2008-08-25 15:44:52 UTC
*** Issue 145009 has been marked as a duplicate of this issue. ***
Comment 9 Petr Dvorak 2008-08-25 15:45:44 UTC
Steps to reproduce
==================

1. Create a new Java Application with a JFrame form
2. Place JButton and JLabel in the form (save the form)
3. Change layout manager of the form to "Grid Bag Layout" (do not save the file)
4. Clone the document view (right-click the editor tab and invoke "Clone Document" from the pop-up menu)
-> you have now two tabs with the JFrame designer, the cloned one is focused, leave it focused...
5. Set the layout manager to "Free design" (using the popup menu above the form)
6. Try to move the JLabel somewhere (try to align it bellow the button, for example)
-> when you drop the JLabel, IOOBE is thrown

Stack trace
===========

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.RangeCheck(ArrayList.java:547)
        at java.util.ArrayList.get(ArrayList.java:322)
        at org.netbeans.modules.form.layoutdesign.LayoutInterval.getSubInterval(LayoutInterval.java:470)
        at org.netbeans.modules.form.layoutdesign.LayoutDesigner.intervalRemoved(LayoutDesigner.java:3702)
        at org.netbeans.modules.form.layoutdesign.LayoutDesigner.layoutChanged(LayoutDesigner.java:2231)
        at org.netbeans.modules.form.layoutdesign.LayoutDesigner.access$100(LayoutDesigner.java:57)
        at org.netbeans.modules.form.layoutdesign.LayoutDesigner$Listener.layoutChanged(LayoutDesigner.java:2197)
        at org.netbeans.modules.form.layoutdesign.LayoutModel.fireEvent(LayoutModel.java:805)
Comment 11 Exceptions Reporter 2008-09-16 18:17:13 UTC
This issue has already 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=27135
Comment 12 zolta 2008-11-18 11:03:57 UTC
Build: NetBeans IDE 6.1 (Build 200805300101)
VM: Java HotSpot(TM) Client VM, 11.0-b12, Java(TM) SE Runtime Environment, 1.6.0_10-beta-b25
OS: Linux, 2.6.22-3-k7, i386

User Comments: 


Stacktrace: 
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.RangeCheck(ArrayList.java:547)
        at java.util.ArrayList.get(ArrayList.java:322)
        at org.netbeans.modules.form.layoutdesign.LayoutInterval.getSubInterval(LayoutInterval.java:467)
        at org.netbeans.modules.form.layoutdesign.LayoutDesigner.intervalRemoved(LayoutDesigner.java:3702)
        at org.netbeans.modules.form.layoutdesign.LayoutDesigner.layoutChanged(LayoutDesigner.java:2231)
        at org.netbeans.modules.form.layoutdesign.LayoutDesigner.access$100(LayoutDesigner.java:57)
Comment 13 zolta 2008-11-18 11:04:06 UTC
Created attachment 73859 [details]
stacktrace
Comment 14 Tomas Pavek 2011-02-02 18:32:01 UTC
*** Bug 190440 has been marked as a duplicate of this bug. ***
Comment 15 Tomas Pavek 2011-02-02 18:49:43 UTC
There is a big flaw in LayoutDesigner causing that some adjustment changes reacting on component removals are performed more than once - if there is more than one designer for the same model.

It's a question whether all the reported exceptions are from the cloned views, or there is yet another bug causing that more than designer is initialized on the same model. (Without cloning the document view this should not be possible.)
Comment 16 asenk 2011-10-04 10:09:16 UTC
Fixed in 7.1 - Free Design improvements
Comment 17 asenk 2011-10-04 10:09:40 UTC
Verified

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)