( Please refrain from top-posting, Lee it is very confusing. )
> I have an applet that I wrote, and I'd like to import that jar file
> somehow and extend the program.
The applet element has an 'archive' attribute, it might
look like this..
<applet
code='org.jdesktop.jdic.screensaver.ScreensaverApplet'
archive='api/sb-api-dev.zip,jar/bouncingline.jar'
width=200
height=200
Note that the main applet is in 'sb-api-dev.zip', while that
applet loads other classes from 'bouncingline.jar' (in this
case, they are for a screensaver animation).
If you add the HHTPclient (or whatever jar it is) to the
'archive' attribute of your applet element, then *your* applet
should have access to all the public members of the
HTTPclient jar.
>..It has certain functions in it that
> I'd like to use.
As long as they are declared 'public', it should be no problem.
> Would it be better if I just extracted all the class files from it?
No! That causes more problems than it fixes.
HTH
Andrew T.
Lee - 16 Jul 2006 18:33 GMT
> ( Please refrain from top-posting, Lee it is very confusing. )
ah! sorry, my client has a way of hiding the forwarded text below and
makes me forget about it.
> <applet
> code='org.jdesktop.jdic.screensaver.ScreensaverApplet'
> archive='api/sb-api-dev.zip,jar/bouncingline.jar'
> width=200
> height=200
> >
Would this work then? I'm not sure why you have a zip file in your
archive attribute.
<applet
code='org.apache.commons.httpclient.*'
archive='myapplet.class, httpclient.jar'
width=300
My applet would be myapplet.class, and httpclient.jar would be the jar
file I'm trying to import into my code.
In my code I'd have a statement like this:
import org.apache.commons.httpclient.*;
Thanks!
Oliver Wong - 18 Jul 2006 14:52 GMT
>> ( Please refrain from top-posting, Lee it is very confusing. )
> ah! sorry, my client has a way of hiding the forwarded text below and
[quoted text clipped - 18 lines]
> In my code I'd have a statement like this:
> import org.apache.commons.httpclient.*;
I believe the code attribute would be the fully qualified name of your
applet. So my guess is it's something like:
<applet
code="foo.bar.myapplet"
archive="httpclient.jar"
width="200px"
height="200px"
/>
where you'd replace foo.bar with whatever package your applet is in.
- Oliver
Andrew Thompson - 18 Jul 2006 16:28 GMT
(A.T.)
> > <applet
> > code='org.jdesktop.jdic.screensaver.ScreensaverApplet'
> > archive='api/sb-api-dev.zip,jar/bouncingline.jar'
....
> ...I'm not sure why you have a zip file in your archive attribute.
A Jar file is simply a specialist form of Zip file.
Try this, make a copy of a jar file, rename it to .zip
and open it.
(I am presuming that Oliver answered your technical question)
Andrew T.