• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what's difference between codebase and code in applet tag

 
chifeng tang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear all:e
can you guy explain and give a example what's the difference between code and codebase in the applet tag
Thanks a lot
Sincerely yours
 
Rowan Brownlee
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chifeng,
Extract from 1.2 docs follows. Code is mandatory while Codebase is optional. Code specifies a class, while Codebase shows a location.
http://java.sun.com/products/jdk/1.2/docs/guide/misc/applet.html
Example follows
~~~~~~~~~~~~~~~
<applet codebase="http://java.sun.com/applets/NervousText/1.1"
code="NervousText.class" width=400 height=75>

CODEBASE = codebaseURL
This OPTIONAL attribute specifies the base URL of the applet--the directory that contains the applet's code. If this attribute is not specified, then the document's URL is used.
CODE = appletFile
This REQUIRED attribute gives the name of the file that contains the applet's compiled Applet subclass. This file is relative to the base URL of the applet. It cannot be absolute. One of CODE or OBJECT must be present. The value appletFile can be of the form classname.class or of the form packagename.classname.class.
~~~~~~~~~~~~~~~~~
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic