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 135710 - Code left in after deleting Swing Controls
Summary: Code left in after deleting Swing Controls
Status: RESOLVED INVALID
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker with 1 vote (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-23 15:17 UTC by carentrica
Modified: 2008-05-26 09:04 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 carentrica 2008-05-23 15:17:10 UTC
I created a new Basic Java Desktop Application, but didn't need the status bar, so I selected it in the Inspector and 
deleted it. Suddenly my source was full of red. 

The delete had not removed the associated event listeners!

My NetBeans version is:
Product Version: NetBeans IDE Dev (Build 20080520075433)
Java: 1.6.0_05; Java HotSpot(TM) Client VM 10.0-b19
Comment 1 Jan Stola 2008-05-26 09:04:28 UTC
The GUI builder takes care about code in initComponents() method and about event listeners added using GUI builder's UI 
e.g. through Events menu item or Events tab in Properties. The code outside these guarded sections is treated as if it 
was added manually (e.g. handcoded) and as such is not automatically removed e.g. must be removed manually becuase was 
manually added. It probably was not obvious for Java Desktop Application because the code in question was not added 
manually by you, but by author of this template.

Maybe we should consider possibility to specify (in the corresponding wizard) that some parts of the application (like 
status bar or menu) should not be generated. Feel free to fill an enhancement about that.