tags:

views:

54

answers:

1

I am just getting started with Java and NetBeans, and I will probably ask a fair number of questions here in the next week or two.

So here's my problem. When I create event-handling code for a component on a form, it shows up with grayed-background lines and a "do not edit" warning. They don't need to post the warning, because the code cannot be edited! However, I may (and have) goof by accidentally double-clicking a component, which inserts actionPerformed code in my main.java file.

I find that that grayed portion of the actionPerformed code can't be moved or deleted. Is there a secret ritual by which I can eliminate or move such code blocks?

Thanks for any help with this.

+1  A: 

Go back into the form editor and simply delete the "xxxActionPerformed" out of the text box (in the list of possible event handlers).

Explained in slightly more detail here

Michael Myers
Thanks, that was exactly the ticket. I actually wish I could move these protected blocks around, just to improve the logical flow of my code, but I'll settle for the fact that I don't have to work out the whole event listener process.
John R Doner