dcsimg
Package Problem
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   arunim_devroy
Posted On:   Tuesday, February 26, 2008 03:19 PM

Hi, I am trying to access a Java class created by Netbeans 6.0 the name of the class is Project2View.class this class is being created by GUI of Netbeans. The package path is default path set by Netbeans 6.0 ie: C:UsersarunimDocumentsNetBeansProjectsProject2 (Project2 is the package name)...... This class dynamically load another client class during run time, the code for which is //import project2.*; public class plugin { public BufferedImage getimage() { //Project2View resource = new Project2View(); } public void setimage(BufferedImage im) { //Project2View resource; } } I am   More>>


Hi,


I am trying to access a Java class created by Netbeans 6.0 the name of the class is Project2View.class this class is being created by GUI of Netbeans. The package path is default path set by Netbeans 6.0 ie: C:UsersarunimDocumentsNetBeansProjectsProject2 (Project2 is the package name)...... This class dynamically load another client class during run time, the code for which is



//import project2.*;



public class plugin {

public BufferedImage getimage()
{
//Project2View resource = new Project2View();
}
public void setimage(BufferedImage im)
{
//Project2View resource;
}
}


I am able to compile/access this plugin.class on runtime and it's methods no problem with that but if i uncomment the lines



1. //import project2.*;
2. //Project2View resource = new Project2View();
3. //Project2View resource;



The class is not able to get compiled says package *project2 not found*. Both the class Project2View and plugin are in the same package but at different file depth.



The location of the above stated class(plugin) is "C:UsersarunimDocumentsNetBeansProjectsProject2custom" and that of the Project2View.class is "C:UsersarunimDocumentsNetBeansProjectsProject2 uildclassesproject2" ( <-- is what i suppose it is the class path cos this is the only location i can search it) the compile path of the plugin class is "javac -classpath C:UsersarunimDocumentsNetBeansProjects plugin.java"



I am pretty sure that it's a path problem since when i write the same code by adding a new package/class from GUI the code run perfectly.



This is my first post on the forum hoping for some help.

   <<Less
About | Sitemap | Contact