Solved

NET BEANS-  Import Error

Posted on 2006-10-19
3
806 Views
Last Modified: 2013-12-22
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);
    }
}




0
Comment
Question by:ahowe01
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
Venabili earned 500 total points
ID: 17769505
C:\Kamin\DrawingBox.class needs to be C:\Kamin\CSLib\DrawingBox.class if I read the error correctly.
Check your C:\Kamin\ folder
0
 

Author Comment

by:ahowe01
ID: 17769712
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)
0
 
LVL 20

Expert Comment

by:Venabili
ID: 17772124
Does your class NameInBox have a method drawRect?
Don't you actually try to say:
d.drawRect(150, 150, 100, 100); instead?
0

Featured Post

Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question