you are calling this constructor, the default constructor:
compAdd c1 = new compAdd();
but you have only provided a constructor which takes an argument (a String object)
the compiler will create a default constructor for you, so you don't have to write it, but only if it doesn't find any constructors in your code.
so, either you add a default constructor to your compAdd class, or you change the call to the constructor to something like this:
compAdd c1 = new compAdd("some String");
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
If you don't know java why are you starting with gui when you don't know even the basics of the language?
Start by writing simple console programs and learn how to use classes, extending them . . .
javaAddict
Nearly a Senior Poster
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
If you don't know java why are you starting with gui when you don't know even the basics of the language?
Start by writing simple console programs and learn how to use classes, extending them . . .
Exactly when you are learning to Swim, you just don't directly jump into the middle of the ocean, you start in the baby pool first.
stephen84s
Nearly a Posting Virtuoso
1,443 posts since Jul 2007
Reputation Points: 668
Solved Threads: 154