开发者

netbeans copied form invalid

Maybe it's just me, but i've encountered strange bug developing some swing UI in NetBeans.

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.

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. To be clear, all my custom JPanel bui开发者_开发技巧lt from default swing components forms are working well, but ones that are contain any other custom panels, are failing.

Error message is: Error in loading component: [jPanel]->myJPanel Cannot load component class com. .... .myJPanel The component can't be loaded

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.

…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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜