While extending a class with JApplet, not able to load applet in browser, giving java.lang.ClassNotFoundException. I'm using <APPLET> tag.
4 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jasmin_Mehta
Posted On:   Friday, March 1, 2002 07:17 AM

Browse your files here

Hi,

Can somebody give me step by step instruction after reading my below settings/code?




I have loaded java-plugin JRE 1.4, plus kept swingall.jar file in bin directory of WEB-INF on tomcat 4.0.2.



this is my code new.html











---------------------------

and my class file MultiFileSelection.class is in WEB-INFclasses and in pakage mdn.upload

Thanks in advance
Jasmin

Re: While extending a class with JApplet, not able to load applet in browser, giving java.lang.ClassNotFoundException. I'm using <APPLET> tag.

Posted By:   John_Hala  
Posted On:   Thursday, April 25, 2002 10:41 PM

Did you find any answers elsewhere yet?

Re: While extending a class with JApplet, not able to load applet in browser, giving java.lang.ClassNotFoundException.

Posted By:   Jasmin_Mehta  
Posted On:   Monday, March 4, 2002 07:00 AM

Hello all,

I'm giving my JApplet code too below. Please let me know if anything wrong in it, which makes my applet not loading by giving java.lang.ClassNotFoundException.




package mdn.upload;


import java.io.File;
import javax.swing.*;
import java.awt.event.*;
import java.awt.Graphics;


public class MultiFileSelectionTest extends JApplet {

public JPanel panel;


public JFileChooser chooser;




public MultiFileSelectionTest() {

}




public void init() {


}




public void start() {


panel = new JPanel();


chooser = new JFileChooser();


chooser.setDialogTitle("Select Files");


chooser.setMultiSelectionEnabled(true);


chooser.showOpenDialog(null);


panel.add(chooser);



File[] files = chooser.getSelectedFiles();


for (int i = 0; i < files.length; i++) {


System.out.println(files[i]);
}


}


public void paint(Graphics g) {

panel.setSize(100,100);

panel.setVisible(true);
}
}

Re: While extending a class with JApplet, not able to load applet in browser, giving java.lang.ClassNotFoundException. I'm using &lt;APPLET&gt; tag.

Posted By:   Dhiren_Bhatia  
Posted On:   Friday, March 1, 2002 09:44 AM

Try this,

In your applet tag change the CODE field to:

CODE="mdn.upload.MultiFileSelectionTest"



and change the CODEBASE field to:


CODEBASE=="./WEB-INF/classes"



You never explicitly have to specify the '.class' extension in such cases.

Hope this helps

Re: While extending a class with JApplet, not able to load applet in browser, giving java.lang.ClassNotFoundException. I'm using &lt;APPLET&gt; tag.

Posted By:   Daniel_Baylon  
Posted On:   Friday, March 1, 2002 08:49 AM

You need to use tag in html.


I think that in sun site exists an application that converts applet tag to object tag.


Regards