The Artima Developer Community
Sponsored Link

Java Answers Forum
class not found

1 reply on 1 page. Most recent reply: Jun 4, 2002 6:28 AM by Kishori Sharan

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
geoff

Posts: 3
Nickname: cakewalkr7
Registered: Jun, 2002

class not found Posted: Jun 4, 2002 5:21 AM
Reply to this message Reply
Advertisement
I have written this applet... which I'm not sure even works... but when I go to run the html page, it says class AlarmContainer not found. However, it's in the same directory as the html page calling the applet. Is there a reason why it wouldn't be able to find this class file? Here's my html code that creates the applet on the page. Thanks.

<applet code="AlarmContainer" width="200" height="200" ID="Alarm" codebase="http://java.sun.com/products/plugin/1.2/jinstall-12-win32.cab#Version=1,2,0,0">
  <PARAM NAME="CODE" VALUE="AlarmContainer.class">
  <PARAM NAME="type" VALUE="application/x-java-applet;version=1.2">
  <param name="snd" value="alarm.au">
  <param name="bgColor" value="233,10,34">
  <param name="Times" value="7:19|8:15">
<EMBED type="application/x-java-applet;version=1.2" java_CODE="AlarmContainer.class" WIDTH="200" HEIGHT="200"  pluginspage="http://java.sun.com/products/plugin/1.2/plugin-install.html"><NOEMBED>
alt="Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, for some reason."
	Your browser is completely ignoring the &lt;APPLET&gt; tag!
</NOEMBED></EMBED>
  alt="Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, 
  for some reason." Your browser is completely ignoring the &lt;APPLET&gt; tag! 
</applet> 


Kishori Sharan

Posts: 211
Nickname: kishori
Registered: Feb, 2002

Re: class not found Posted: Jun 4, 2002 6:28 AM
Reply to this message Reply
Since your applet class is at the same location as your html document, you don't need to set codebase attribute of applet tag. It seems from your post that you were trying to use OBJECT tag because maybe your applet contains swing controls. The codebase attribute that you are using is for OBJECT tag and not for applet tag. Here is what you need to do.
1. Write a simple applet tag with no codebase attribute in it. Use code attribute for applet tag which should have the value as the name of the applet class as code="abc.class". If your applet class is in a package , say p1, then your code attribute will be as CODE="p1.abc.class". If your applet class is in a package then you must also use CODEBASE attribute and usually on local machine it will be same as one of your classpath entry, so that CODEBASE + CODE should give you the complete path of your applet class.
2. If you are using swings in your applet, then perform step1 and then download HTML converter from java.sun.com. Run HTML converter against your html file containg applet tag in STEP1 and it will give you OBJECT and EMBED tag correctly. Run the new html file and I hope you will get what you want.

Thanks
Kishori

Flat View: This topic has 1 reply on 1 page
Topic: javaSwings Previous Topic   Next Topic Topic: EJB Transaction rollback exception in Visual Age environment

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use