java 双击设计选项卡中的对象后删除 Netbeans 自动生成的代码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12961409/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Remove Netbeans Auto Generated Code After Double-Clicking an Object in Design Tab
提问by Kairan
So Im using Netbeans and the Design tab, placing labels, textboxes, etc. Great, however when you double-click on say a label it autogenerated this code:
所以我使用 Netbeans 和“设计”选项卡,放置标签、文本框等。很好,但是当你双击一个标签时,它会自动生成以下代码:
private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
Now I didn't want it to do that, but when I highlight and attempt to delete it - Netbeans does not allow me to do so. How do I go about removing this?
现在我不希望它这样做,但是当我突出显示并尝试删除它时 - Netbeans 不允许我这样做。我该如何去除这个?
回答by Kairan
In the Design mode you select the particular object and click Events under Properties and remove the event from the event property
在设计模式中,您选择特定对象并单击属性下的事件并从事件属性中删除事件
回答by Adam
To answer Brian's question on the more general case:
回答布赖恩关于更一般情况的问题:
If you have auto-generated variables that are hiding in the Design mode, and you cannot select and remove them, you can usually delete them with the following steps(in NetBeans7.4):
如果您有隐藏在设计模式中的自动生成的变量,并且您无法选择和删除它们,通常可以通过以下步骤删除它们(在 NetBeans7.4 中):
- Go in the Design mode to the top window
menu -> Windows -> Navigator
. You will see Group "Navigator"popped up on the left (usually). - Now you can delete unwanted variables (or edit them) with the right clickmenu.
- 在设计模式中转到顶部窗口
menu -> Windows -> Navigator
。您会看到左侧(通常)弹出组“导航器”。 - 现在您可以使用右键菜单删除不需要的变量(或编辑它们)。