This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with constructor test