简体   繁体   English

如何在 Netbeans 中重新排序自动生成的方法?

[英]How to reorder automatically generated methods in Netbeans?

When using Netbeans' features for generating event handlers from a GUI, for example, while the body of the generated methods are editable, I cannot find a way to change the order of the generated methods within the code of a class.例如,当使用 Netbeans 的特性从 GUI 生成事件处理程序时,虽然生成的方法的主体是可编辑的,但我找不到一种方法来更改类代码中生成的方法的顺序。

Cutting for cutting and pasting is not allowed with generated code.生成的代码不允许剪切和粘贴。

How instead might I do this?我该怎么做呢?

Thank you very much!非常感谢你!

You can't do that in Netbeans.你不能在 Netbeans 中做到这一点。 It's not really a priority because you can use the Navigator instead.这不是真正的优先事项,因为您可以改用 Navigator。

If you really want to move those blocks, open the Java file with an other editor (Gedit, Notepad...) and re-order the blocks here.如果您真的想移动这些块,请使用其他编辑器(Gedit、记事本...)打开 Java 文件并在此处重新排序块。

You can also remove the //GEN-FIRST and //GEN-LAST to make them editable in Netbeans.您还可以删除//GEN-FIRST//GEN-LAST以使其在 Netbeans 中可编辑。

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

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