File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes Uploading my Applets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Uploading my Applets " Watch "Uploading my Applets " New topic

Uploading my Applets

Glenn Castro
Ranch Hand

Joined: Aug 24, 2003
Posts: 78
I have a java file named Upon compiling, it produced two classes named Client.class and Client$1.class(I think this is a subclass when i create a new Runnable object). When I upload the Client$1, it shows an error "invalid class format". Is this class necessary in uploading my applets? Is it possible if i upload my classes inside a jar?

Glenn Castro<br />Sun Certified Web Component Developer
Korol Bloom
Ranch Hand

Joined: Jan 13, 2004
Posts: 33
what do you mean with uploading? Sending the files to a webserver? Do you get the same error if you start this locally?
I suggest, pack the files in a jar. Jars are much easier to handle than single classes, if your applet gets bigger.
, korol
Jason Huntz

Joined: Mar 10, 2004
Posts: 7
The class is necessary and it is probably the Runnable as you suspected. I agree putting it in a jar might make the process easier
Glenn Castro
Ranch Hand

Joined: Aug 24, 2003
Posts: 78
Ok, thanks guys for the advice.
Now, I have new question. How can I call the class in the jar file in HTML.
When it is not jar. I used the ff. in the html
<applet code="Client.class" width=300 height=300>
if I upload the jar file, should it be:
<applet code="Client.jar" width=300 height=300>
where Client.jar is the name of the jar file
Joe Ess

Joined: Oct 29, 2001
Posts: 9188

<applet code="Client.class" archive="whatever.jar" width=300 height=300>
If you have more than one JAR file, you can list them separated by commas.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Uploading my Applets
It's not a secret anymore!