Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Missing Applet

 
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.
 
High Plains Drifter
Posts: 7289
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.
 
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.
 
Paddy spent all of his days in the O'Furniture back yard with this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic