Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

NET BEANS-  Import Error

Posted on 2006-10-19
3
Medium Priority
?
811 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

715 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