ALOR
ALOR

Reputation: 545

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

Upvotes: 1

Views: 2261

Answers (2)

Uhlen
Uhlen

Reputation: 1778

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.

Upvotes: 2

trashgod
trashgod

Reputation: 205855

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.

Upvotes: 1

Related Questions