简体   繁体   English

netbeans复制的表单无效

[英]netbeans copied form invalid

Maybe it's just me, but i've encountered strange bug developing some swing UI in NetBeans. 也许只是我一个人,但是我遇到了一个奇怪的错误,即在NetBeans中开发一些摆动UI。

Here is the situation - i've made all needed GUI classes (mostly as designer forms) in some separate sandbox project and now i want to attach them to main sources. 情况就是这样-我已经在一些单独的沙盒项目中制作了所有需要的GUI类(主要是设计器表单),现在我想将它们附加到主要资源上。

When i try to copy those classes (really, a whole package) to my main project - as well as by NB copy\\paste as by file manager copy, i get the same behavior - i can't open composite form in designer. 当我尝试将这些类(实际上是整个包)复制到我的主项目中时,以及通过NB复制\\粘贴和文件管理器复制时,我得到的行为相同-我无法在设计器中打开复合表格。 To be clear, all my custom JPanel built from default swing components forms are working well, but ones that are contain any other custom panels, are failing. 需要明确的是,我从默认的swing组件表单构建的所有自定义JPanel都运行良好,但是包含任何其他自定义面板的JPanel都失败了。

Error message is: Error in loading component: [jPanel]->myJPanel Cannot load component class com. 错误消息是:加载组件时出错:[jPanel]-> myJPanel无法加载组件类com。 .... .myJPanel The component can't be loaded .... .myJPanel无法加载该组件

Any ideas much appreciated. 任何想法表示赞赏。

Have tried to rebuild your project? 试图重建您的项目? Right-click on the project/module and choose "Clean and build all". 右键单击项目/模块,然后选择“清理并构建所有”。

I've encountered this many times after I've updated the sources from the repository when some collegue have added a new custom component. 当一些同事添加了新的自定义组件后,我从存储库更新了源代码之后,我已经遇到了很多次。

I've moved forms from one project to another using both approaches. 我已经使用两种方法将表单从一个项目移动到了另一个项目。

When using a file system copy, verify that your package names and paths are correct, and check that you have copied the panel's related .form file from the old project's src tree into the corresponding place in the new project. 使用文件系统副本时,请验证软件包名称和路径正确,并检查是否已将面板的相关.form文件从旧项目的src树复制到新项目中的相应位置。

…ones that contain any other custom panels are failing. …包含任何其他自定义面板的面板都失败了。

Before opening the destination project, edit the .java file to correct the package declaration, and edit the .form file to correct any stray fully qualified class names of your custom components. 在打开目标项目之前,请编辑.java文件以更正软件包声明,并编辑.form文件以更正您的自定义组件的任何杂散的完全合格的类名。

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

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