help please!!!!!...... package problem

help me!!

I have create a package, but after setting classpath it shows package not found.

first i have created a folder name pkg, in that i have created comp folder

second I am imported this file in ex.java, but this file is in another folder named example

i have set the classpath using

set classpath=%classpath%;D:\pkg

here is details what have done.

D:\pkg\comp

-

package pkg.comp;

import java.awt.*;

import javax.swing.*;

public class lgcomp extends JComponent

{

JLabel lbllg,lblpwd;

JPasswordField txtpwd;

JButton btnsubmit;

public lg()

{

lbllg = new JLabel("Login");

add(lbllg);

lblpwd = new JLabel("Password");

add(lblpwd);

txtpwd = new JTextField(20);

add(txtpwd);

btnsubmit = new JButton("Submit");

add(btnsubmit);

}

}

--

D:\example\ex.java

i am calling this package

import pkg.comp;

import java.awt.*;

import javax.swing.*;

public class ex extends JApplet

{

JPanel pn;

lgcomp login;

public void init()

{

pn = new JPanel();

getContentPAne().add(pn);

login = new lgcomp();

pn.add(login);

}

}

[1286 byte] By [logictrenda] at [2007-11-26 20:52:24]
# 1
You added D:\pkg to your classpath so your compiler will search for pkg.comp inside the D:\pkg folder, so D:\pkg\pkg\comp. Your classpath should contain the folder above your pkg dir...
Peetzorea at 2007-7-10 2:17:48 > top of Java-index,Java Essentials,New To Java...
# 2
thanks i am putting the pkg folder folder in D:\example\pkg folder then,what should be classpath for this.
logictrenda at 2007-7-10 2:17:48 > top of Java-index,Java Essentials,New To Java...
# 3
Thanks I have got it
logictrenda at 2007-7-10 2:17:48 > top of Java-index,Java Essentials,New To Java...