Getting rid of inadvertent "actionPerformed: code in Java Netbeans [duplicate]
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 elimin开发者_如何学编程ate or move such code blocks?
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
精彩评论