Netbeans GUI Builder:如何编辑生成的代码 [英] Netbeans GUI Builder: how to edit generated code
问题描述
我正在使用Netbeans GUI Builder,并且正在向表单中添加JTree,因为这样做确实是Netbeans为JTree生成了所有代码.
Im using Netbeans GUI Builder and I am adding a JTree to my form, as it does Netbeans is generating all the code for the JTree.
我想知道的是,Netbeans中是否有一种方法可以将代码添加到生成的代码中……就像在它创建的Generated Code
部分的源代码视图中
What i want to know is, is there a way in Netbeans to add code to the generated code... like in the source view in the Generated Code
section it creates
jTree = new javax.swing.JTree();
我想添加populateJTree.addNodes(null, folder)
,所以它看起来像
i want to add populateJTree.addNodes(null, folder)
so it looks like
jTree = new javax.swing.JTree(populateJTree.addNodes(null, folder));
有没有办法做到这一点
推荐答案
我对其进行了排序,如果转到JTree的Properties
窗口和Code
部分,则可以添加
i sorted it, if you go to the Properties
window for the JTree and the Code
section, you can add
new javax.swing.JTree(populateJTree.addNodes(null, folder));
到自定义创建代码部分,它将创建
to the custom creation code part and it will create
jTree = new javax.swing.JTree(populateJTree.addNodes(null, folder));
这篇关于Netbeans GUI Builder:如何编辑生成的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!