This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Missing Applet

 
Tim Barker
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TO Expert:
I am trying to get an applet to work. I ran the applet off line in my browser and it worked okay. Then when I uploaded to my web site it stopped working. I noticed earlier that the applet would not work if I changed directories. In other words, when I droped it in to a folder it stopped working (I mention this because I think this is related to why it will not work now). The source code contains the line:
Public class yig3 extends java.applet.Applet implements Runnable
I am thinking that the java.applet.Applet is causing the problem, but I may be wrong.
I orginally had this HTML Code:
<applet codebase="." code="yig3.class" height=250 width=250>
I tried changing it to this:
<applet code=yig3.class codebase=java/yig3/ width=255 height=275>
Is it my html or my source code that is giving me problems? Any assistants will be appreciated.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim -
There's no way to tell from above if your Applet code has a problem, but let's assume that it doesn't.
One way to test for codebase issues: put the .class at the top of the web servers document base, and remove the codebase tag altogether. If that works, you'll know the problem lies in the way you're using codebase.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
 
Tim Barker
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok I'll try that as soon as I figure out what a web servers document base is.
 
Pavel Kletskov
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tim Barker:
Ok I'll try that as soon as I figure out what a web servers document base is.

Hi
if applet code lies in the same directory as html page , you don't need codebase variable at all in your tag. Otherwise you use relative path to your class from the directory of html.
Go to java.sun.com and enter CODEBASE in search - I bet you'll find there the info.
Pavel.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic