NoClassDefFound Error while running an applet

HI,

I downloaded the project named MouseEventDemo Project from the link:
http://java.sun.com/docs/books/tutorial/uiswing/examples/events/index.html#MouseMotionEventDemo

And pasted the events folder from extracted content to my bin folder where my javac.exe is present.

Now the compilation of java files present in it , is successful but i get an error when i try to execute by an html file, say BlankArea.html to execute BlankArea.java.The contents of file are:








I am attaching the events folder.
Please guide me.

Thanks,
Tanushri.





Comments

  • Hi,i think that you might not be too far from the solution to your little problem.Now yes you compiled the code and it complied without any fuss but the code is located in a folder in your bin folder,so at your applet tag attributes i.e ,try and specify where the code is if it isn't visibly found in the same folder where you have stored your html files.so try this



    I designed a html file that contains an applet and my applet was in a different folder called classes.i had to specify where the java code could be located since it is in a different folder IN the same folder where my html files are.Consider it,trying to import a package in java.

    I hope this helps you in solving it

  • Hi,i think that you might not be too far from the solution to your little problem.Now yes you compiled the code and it complied without any fuss but the code is located in a folder in your bin folder,so at your applet tag attributes i.e ,try and specify where the code is if it isn't visibly found in the same folder where you have stored your html files.so try this



    I designed a html file that contains an applet and my applet was in a different folder called classes.i had to specify where the java code could be located since it is in a different folder IN the same folder where my html files are.Consider it,trying to import a package in java.

    I hope this helps you in solving it

  • HI,

    I have my Html file and class file in the same folder.
    Also i have tried executing with the codebase ="."
    Please suggest me some other solution.

    Thanks,
    Tanushri.
  • Hi again.successful compilation of a java code doesn't guarrantee a successful run,so i suggest you try to first run the applet by using the appletViewer,say appletViewer Beans.html in your command line on your cmd after compilatiion.

    This will display the applet in html format.if it displays,then your code will have to be carefully looked into but if it doesn't,dont use the applet anymore because there might be some classes and methods used that are in packages created and used only by them(where you downloaded it from).Besides it is advisable to design your own applets than to download due to this problems.

    if you still have the same problem,kindly send me a copy of your code so that i can see what i can do.my email address is [email protected] another thing,did you place a dot(.) as the codebase value in your applet attributes,because you wrote that you tried executing with the codebase =".".if you did,remove the dot(.) and
    try running the html file again because the dot(.) is kinda telling the browser that the classfile is located somewhere and since it cant locate it,it throws such exception which you are currently getting.

    Does it solve your problem?.if it didn't, mail your code to me using the stated email add.
  • Hi again.successful compilation of a java code doesn't guarrantee a successful run,so i suggest you try to first run the applet by using the appletViewer,say appletViewer Beans.html in your command line on your cmd after compilatiion.

    This will display the applet in html format.if it displays,then your code will have to be carefully looked into but if it doesn't,dont use the applet anymore because there might be some classes and methods used that are in packages created and used only by them(where you downloaded it from).Besides it is advisable to design your own applets than to download due to this problems.

    if you still have the same problem,kindly send me a copy of your code so that i can see what i can do.my email address is [email protected] another thing,did you place a dot(.) as the codebase value in your applet attributes,because you wrote that you tried executing with the codebase =".".if you did,remove the dot(.) and
    try running the html file again because the dot(.) is kinda telling the browser that the classfile is located somewhere and since it cant locate it,it throws such exception which you are currently getting.

    Does it solve your problem?.if it didn't, mail your code to me using the stated email add.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories