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 180640 - Component connection not resolved causing designer to crash
Summary: Component connection not resolved causing designer to crash
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P2 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-11 18:22 UTC by bdoolittle
Modified: 2011-11-16 16:43 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 bdoolittle 2010-02-11 18:22:44 UTC
Easily recreated problem. The scenario is just an example.  In this I use background as the culprit for ease but it could be any property.
1. Create a new jFrame form.
2. Add a panel and give it a background so you can see it.
3. Place a button on the panel.
4. Give jButton1 a background
5. Place another button on the panel.
6. Add a background to jButton2 by selecting "Value from existing component" then select jButton1 then background. Both buttons show the same background color.
7. Delete jButton1.
8. Close the form.
9. Reopen the form.  
10. The designer threw a null exception and the form can't be shown. The .form file contains an unresolvable link from jButton2 back to jButton1 which is now gone (<Component connection=jButton1 ... >). The code shows an error but in protected area and with the designer gone it's not easy to fix ... especially given that you have no clue as a user what happened and what to do about it.

Easy way out would be to catch the missing link rather than crash. More elegant would be to chain the links and resolve or warn when the key component is removed.
Comment 1 Jan Stola 2010-02-24 07:24:44 UTC
Fixed. The exception is no longer thrown. The designer opens correctly and there is an 'Invalid Connection' warning next to the problematic property in Properties window.

Modified file: http://hg.netbeans.org/cdev/rev/633d3ec2aef7