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 157573 - No way to throw exception from initComponents
Summary: No way to throw exception from initComponents
Status: RESOLVED DUPLICATE of bug 116989
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P1 blocker with 1 vote (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-28 18:29 UTC by misterm
Modified: 2009-01-29 18:03 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 misterm 2009-01-28 18:29:29 UTC
If a custom component throws a checked exception in its constructor, there is no way to change initComponents() 
signature in order to declare it.
Comment 1 Tomas Pavek 2009-01-29 18:03:01 UTC
True, this is not supported. A known design limitation, would be nice to implement.

There is a workaround - obvious, but requires to write code by hand. E.g. instantiate the component in code before
calling initComponents() and handle the exception the way you want. Assign the component to a field. Then in the GUI
builder specify "Custom Creation Code" for the component - use the field where you assigned the component.

*** This issue has been marked as a duplicate of 116989 ***