Re: Copy and Paste JPanel custom component Netbeans 5.5
Josiah Haswell <[email protected]> Wed, 07 Nov 2007 00:13:11 -0700
| Newsgroups | gmane.comp.java.netbeans.user-interface |
|---|---|
| Message-ID | <[email protected]> |
RichardF wrote: > Hi, > > I am suddenly getting 'errors occurred in loading the form data ... ' error > message when i load a form. This error is then followed by 'error in loading > component' for each instance of a custom component - The form contains a > couple of custom JPanel components that reside in the same package (I used > the feature to copy from the component in project explorer and paste onto > the form - which did work very nicely). > > Anyway, I tried creating a new form and tried to add one of the custom > components to it: the copy/paste method described above just does nothing. > And i tried adding the jar to the Palette but the wizard just says 'the > selected JAR archive does not contain any JavaBeans components.' I can't > see anything wrong with these components and they both compile fine. > > > The only thing I can think of is by recreating each custom component and > then the form - which is quite a lot of work. > > Any suggestions gratefully welcome. > > > (btw the project successfully compiles and is up-to date before i tried > this). > > Regards, > Rich. > > Rich, The Netbeans GUI builder won't load forms if they're not JavaBeans. I don't think it'll load any class that has arguments in the constructor, or if it instantiates class variables in the constructor. At least, you have to be careful what happens in the constructor of a form. Try commenting out everything but the generated initComponent() method in your constructor, remove all the arguments if there are any, and try loading the form again. Joe