Pages

Sunday, August 22, 2010

How to remove events not used in NETBEANS

You might want to remove some events that are not used anymore in your NetBeans file project. You cannot just delete it from the code editor because NetBeans lock it, indicated by the gray color of the line of codes.
Here's how to remove those unused codes:

1. Go to the GUI builder, the Design view of your file.
2. Right click and select Properties. The default open tab is the Properties list. Select the Events tab.

3. You would see events list and what handlers these events are associated.

4. Choose the event you'd like to delete by selecting the [...] button.



5. A new dialog will pop up. Select the handler then click Remove button.

6 comments:

Anonymous said...

Ah, but how to do it when the component no longer exists? The event handler is left behind, but cannot be removed it seems. netbeans 7.0.1

jet MUSIC said...

ooohh, i haven't tried netbeans 7.0.1 yet. I'll review that and get back to your question :)

Anonymous said...

thanks

jet MUSIC said...

It seems like there's no way of doing it so you just have to let those trash codes there. Let's hope to see some improvements in Netbeans 8

Isuru said...

Thanks a lot for this one. I was getting really annoyed with NetBeans because of this.

Anonymous said...

So much time, sooo many bugs.

Post a Comment