Link to home
Start Free TrialLog in
Avatar of ahowe01
ahowe01Flag for United States of America

asked on

NET BEANS- Import Error

I've been using JCreator... And now I'm attempting to use NetBeans.  Well here is the error I'm getting and my code.  My DrawingBox class and java file is in the CSLib library.  Why is it not working, when the import is showing as working or at least it's not underlined red???????  


init:
deps-jar:
Compiling 1 source file to C:\Kamin\HWII\build\classes
C:\Kamin\HWII\src\NameInBox.java:21: cannot access DrawingBox
bad class file: C:\Kamin\DrawingBox.class
class file contains wrong class: CSLib.DrawingBox
Please remove or make sure it appears in the correct subdirectory of the classpath.
        DrawingBox d = new DrawingBox();
1 error
BUILD FAILED (total time: 0 seconds)


import CSLib.*;
import java.awt.*;

public class NameInBox
{
    public static void main(String [] args)
    {
        DrawingBox d = new DrawingBox();
        d.setDrawableSize(400,400);
        drawRect(150, 150, 100, 100);
        d.drawString("Thomas Finney", 5, 10);
    }
}




ASKER CERTIFIED SOLUTION
Avatar of Venabili
Venabili
Flag of Bulgaria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ahowe01

ASKER

Thank you!!!   You are the bomb!!!!!!!

Another question... sorta on the same lines... Now I'm erroring out on drawRect(150, 150, 100, 100);  Am I doing something wrong or is it still my NetBeans set up???  


init:
deps-jar:
Compiling 1 source file to C:\Documents and Settings\myr\Desktop\CSLIB\JavaApplication6\build\classes
C:\Documents and Settings\myr\Desktop\CSLIB\JavaApplication6\src\NameInBox.java:22: cannot find symbol
symbol  : method drawRect(int,int,int,int)
location: class NameInBox
        drawRect(150, 150, 100, 100);
1 error
BUILD FAILED (total time: 0 seconds)
Does your class NameInBox have a method drawRect?
Don't you actually try to say:
d.drawRect(150, 150, 100, 100); instead?