Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

applet FAQ number 3 , on netbeans , class not found

 
jon casari
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My applet works fine if I run it locally, but not if it's served from a web server. What gives?

A symptom of this problem might be a message "applet not initialized" at the bottom status bar of the browser window. Make sure you haven't put any required class files into the WEB-INF directory - web servers will not serve any files out of that directory. Move the class files to a publicly accessible directory - the most convenient would be the directory where the HTML file with the applet tag is in.

The problem is that netbeans always moves the .class files to the /class folder when you build a web application , so what should I do I tried this and some variations of this but it wont work

<APPLET code="a/SwingCapture.class" width=350 height=200></APPLET> applet not found
tried SwingCapture.class , /a/SwingCapture.class
<img src="a/sol.jpg" width="1024" height="1024" alt="sol"/> image ok
[ February 09, 2007: Message edited by: jon casari ]
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the SwingCapture class is inside of a directory called "a" which in uderneath the directory where the HTML file is located? Can you download the class manually through the browser by typing in "http://.../a/SwingCapture.class"?
 
jon casari
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes , I can download it
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that case check the web server access logs to see which files the JVM is actually trying to download. Incidentally, the code attribute does not take a filename like "a/SwingCapture.class", but a qualified class name like "a.SwingCapture" ("a.SwingCapture.class" may also work).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic