This week's book giveaway is in the Programmer Certification forum. We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
i am a java beginner.i had built a java program MyCalculaterGuI in notepad,compiled and run it on commond prompt.now i am using netbeans 11.1.i have created a jar file of MyCalculterGUI.class by commond prompt.it runs,works fine.now when i want to add MyCalculater.jar file in my netbeans swing controls as a custom component so that i reuse it
by just drag and drop in any JFrame form.first i added this jar file in my gradle project custom library 'libs' folder which is included in project dependencies.then i added this jar file into swing control by pallete manager.MyCalculater.jar is added in swing control.but when i drag and drop it.it gives following error.
component instantiation error
failed to create an instance of pkg/MyCalculaterGUI class
the class itself was loaded but intantiating failed............
please guide me.
Try to verify that you have a default constructor defined in your class. Most of times I had a similar error with Matisse (the GUI palette in NB 8) it was dued to a null pointer exception raised by constructor.
posted 1 week ago
following is only constructor in my class .
now please tell me how should it look like to solve the above mentioned problem.