Re: Copy and Paste JPanel custom component Netbeans 5.5
Wade Chandler <[email protected]> Wed, 7 Nov 2007 04:57:05 -0800 (PST)
| Newsgroups | gmane.comp.java.netbeans.user-interface |
|---|---|
| Message-ID | <[email protected]> |
One more thing, you have to be sure if you have any 3rd party dependencies..runtime or compile time...they are on the projects classpath. Wade ================== Wade Chandler, CCE Software Engineer and Developer, Certified Forensic Computer Examiner, NetBeans Dream Team Member, and NetBeans Board Member http://www.certified-computer-examiner.com http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam http://www.netbeans.org ----- Original Message ---- From: Wade Chandler <[email protected]> To: [email protected] Sent: Wednesday, November 7, 2007 7:54:37 AM Subject: Re: [nbui] Copy and Paste JPanel custom component Netbeans 5.5 No, it should call the default constructor. You don't have to delete any code from it, but you have to be sure you have a default constructor and your bean isn't dependent upon parameters for it to be instantiated. Wade ================== Wade Chandler, CCE Software Engineer and Developer, Certified Forensic Computer Examiner, NetBeans Dream Team Member, and NetBeans Board Member http://www.certified-computer-examiner.com http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam http://www.netbeans.org ----- Original Message ---- From: Josiah Haswell <[email protected]> To: [email protected] Sent: Wednesday, November 7, 2007 2:13:11 AM Subject: Re: [nbui] Copy and Paste JPanel custom component Netbeans 5.5 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