How to delete methods automatically generated by Netbeans?

3

I'm doing a GUI using JFrame automatically generated by Netbeans and have had times that I double clicked on JButton unintentionally and it automatically generated a code of ActionEvent that can not be edited. p>

As I did not want these methods that I would not use, I opened the code by another editor (Sublime) and I completely removed both methods and calls from it in private void initComponents() .

After deleting them by sublime they ceased to exist when I opened it in Netbeans and the code ran normally.

The problem is that, ever after I change something through NetBeans, those methods mysteriously returned to being called in private void initComponents() . With this, in order to compile without errors, I have to open the Sublime again and remove them.

Ex: Code that I exclude, but returns mysteriously

Could anyone help me?

    
asked by anonymous 15.11.2015 / 15:05

1 answer

3

Do the following:

  • Select JButton (single click);
  • go to the Propriedades (lower right sidebar), and click eventos ;
  • Click the ... button next to the event being created (see an example of how it should look in the photo):
  • In the window that opens, select the button action method and click Remove and then ok :
  • See in the code, the method was removed there too.
  •     
    15.11.2015 / 16:18