简体   繁体   English

Netbeans构建GUI; 如何禁止Netbeans禁止我编辑文本?

[英]Netbeans building GUI; how do I disable Netbeans from disallowing me to edit text?

I find it annoying that Netbeans tries to disable editing the source code whenever I use the GUI builder utility. 我发现Netbeans尝试在使用GUI构建器实用程序时禁用编辑源代码是令人讨厌的。 I have searched in Google but could not find an answer: 我在谷歌搜索但找不到答案:

How do I disable Netbeans from disallowing me to edit my source code? 如何禁止Netbeans禁止我编辑我的源代码? Is this a bug because whenever I right click the .java file, I am able to edit again. 这是一个错误,因为无论何时我右键单击.java文件,我都可以再次编辑。

I don't think that is a bug. 我不认为这是一个错误。 In fact netbeans doesn't allow you to edit the source code in the initcomponents() method. 事实上,netbeans不允许您在initcomponents()方法中编辑源代码。 In the properties window (Ctrl+ Shift+ 7) where you see the main tabs (properties, binding, events and code), after choosing a component and viewing its properties window, if you choose code you can add whatever code you want as in Custom-Creation code, Pre-Creation code, Post-Creation code, pre-Init code, Post-Init Code..... 在属性窗口(Ctrl + Shift + 7)中,您可以看到主要选项卡(属性,绑定,事件和代码),在选择组件并查看其属性窗口后,如果选择代码,则可以在Custom中添加所需的任何代码。创建代码,创建前代码,创建后代码,预启动代码,启动后代码.....

Hope that helps. 希望有所帮助。

编辑Netbeans生成的代码不是一个好主意 - Netbeans将再次还原您的更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM