Date: Wed, 11 Mar 1998 16:51:11 -0800 (PST)
From: Marianne Mueller <Marianne.Mueller@Eng>
Subject: Re: Reg. Java Classes
To: sprabu@hclt.com
--Convocation_of_Eagles_945_000
Content-Type: TEXT/plain; charset=us-ascii
Content-MD5: pz9GZUoWLhEFP5k+H46l9g==
> Yes, i agree that it is possible to install the classes in jar file on the
> browser(both
> netscape and IE) end thru the web. But, i need some pointers where to look
> for. I am
> kinda looking for automatic installation of classes.
There is no good way that I know of to get classes or jar files
automatically installed in some particular directory (say on a
directory on the user's CLASSPATH.)
But if you just want automatic loading of classes, this is what
the browsers and appletviewer do for you. Your applet tag
refers to the codebase and code (or the archive and code) and
the browser automatically loads the classes from that location.
Marianne
p.s. URL from
http:/java.sun.com/products/jdk/1.1/docs/guide/misc/applet.html
--Convocation_of_Eagles_945_000
Content-Type: TEXT/html; name="applet.html"; charset=us-ascii; x-unix-mode=0664
Content-Description: applet.html
Content-MD5: FVcmjtxv44sB5iwzRplBBQ==
Here is an example of a simple APPLET tag:
<applet code="MyApplet.class" width=100 height=140></applet>This tells the viewer or browser to load the applet whose compiled code is in MyApplet.class (in the same directory as the current HTML document), and to set the initial size of the applet to 100 pixels wide and 140 pixels high.
Here's a more complex example of an APPLET tag:
<applet codebase="http://java.sun.com/applets/NervousText/1.1" code="NervousText.class" width=400 height=75> <param name="text" value="Welcome to HotJava!"> <hr> If you were using a Java-enabled browser such as HotJava, you would see dancing text instead of this paragraph. <hr> </applet>This tells the viewer or browser to load the applet whose compiled code is at the URL http://java.sun.com/applets/NervousText/1.1/NervousText.class, to set the initial size of the applet to 400x75 pixels. The viewer/browser must also set the applet's "text" attribute (which customizes the text this applet displays) to be "Welcome to HotJava!" If the page is viewed by a browser that can't execute Java applets, then the browser will ignore the APPLET and PARAM tags, displaying only the HTML between the
<param>
and </applet>
tags
(the alternate HTML).
Here's the result of putting the above example in your HTML file.
(The first time you load this page, you may have to wait for the applet
to be loaded.)
Here is another example of an APPLET tag:
<applet code=A21 width=256 height=256 archive="toir.jar"> <param name=img value=test.gif> <hr> We need to convert some of the standard applets to use archive. Any volunteers? <hr> </applet>In this example, the applet class is A21. Its bytecodes (may) reside in the archive "
toir.jar
". This archive may
also contain the image resource (see resources documentation)
with name test.gif
.
Here's the complete syntax for the APPLET tag. Required elements are in bold. Optional elements are in regular typeface. Elements your specify are in italics.
<APPLET CODEBASE = codebaseURL ARCHIVE = archiveList CODE = appletFile ...or... OBJECT = serializedApplet ALT = alternateText NAME = appletInstanceName WIDTH = pixels HEIGHT = pixels ALIGN = alignment VSPACE = pixels HSPACE = pixels > <PARAM NAME = appletAttribute1 VALUE = value> <PARAM NAME = appletAttribute2 VALUE = value> . . . alternateHTML </APPLET>
CODE, CODEBASE, and so on are attributes of the applet tag; they give the browser information about the applet. The only mandatory attributes are CODE, WIDTH, and HEIGHT. Each attribute is described below.
--Convocation_of_Eagles_945_000--