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);
}
}

