permaculture playing cards*
The moose likes Beginning Java and the fly likes Help with constructor test Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help with constructor test" Watch "Help with constructor test" New topic
Author

Help with constructor test

Nancy Bradley
Ranch Hand

Joined: Feb 25, 2004
Posts: 32
My assignment is to write a program that calculates area and perimeter of a rectangle and an applet that test it.
When I try to compile the applet I get these error messages:
- cannot resolve symbol
variable RectangleTest (this is not a variable)
- cannot resolve symbol
class add
input.add ActionListener(this);
- cannot resolve symbol
class add ( I declare these variables, I do not understand
package c the problem)
c.add x;
- cannot resolve symbol
class add
package c
c.add y;
- cannot resolve symbol
package c
c.add rsults;
- RectangleTest should be declare abstract; it does not define actionPerformed(java.awt.event.ActionEvent) in RectangleTest public class RectangleTest extends JApplet implements ActionListener {
I appreciate your help
Thanks in advance
Nancy Bradley

Ben Buchli
Ranch Hand

Joined: Mar 26, 2004
Posts: 83
Hi,
>>cannot resolve symbol variable RectangleTest
this is an object and you have to declare it in the following way:
RectangleTest rectangleTest = new RectangleTest();
>>cannot resolve symbol class add
here you have a syntax problem (I believe)
correct: c.add(<whatever component> ) ;
>>RectangleTest should be declare abstract; it does not define actionPerformed(java.awt.event.ActionEvent) in RectangleTest public class RectangleTest extends JApplet implements ActionListener {
you have to declare a method actionPerformed( ActionEvent e ). you cant define your own name for this method, as you did with getInformation().
hope that helps.
[ March 28, 2004: Message edited by: Ben Buchli ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Help with constructor test
 
Similar Threads
Returning a boolean value
Help please!!
Plese help! I am very confuse
Need help
Can't resolve compiler error message