Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Uploading my Applets " Watch "Uploading my Applets " New topic
Author

Uploading my Applets

Glenn Castro
Ranch Hand

Joined: Aug 24, 2003
Posts: 78
I have a java file named Client.java. 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
Glenn,
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
Greenhorn

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
Bartender

Joined: Oct 29, 2001
Posts: 8834
    
    7

<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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Uploading my Applets
 
Similar Threads
image compression
few confusions abt applets!
image compression without any defect
Reading and manipulating file content on client machine
Display All images from a folder on a html/jsp page