开发者

Getting rid of inadvertent "actionPerformed: code in Java Netbeans [duplicate]

开发者 https://www.devze.com 2022-12-16 10:31 出处:网络
This question already has answers here: How to remove actionPerformed methods in NetBeans (4 answers) Closed 8 years ago.
This question already has answers here: How to remove actionPerformed methods in NetBeans (4 answers) Closed 8 years ago.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消