Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to access an applet from a folder inside a jar file -- Urgent

 
Paromitabanerjee Banerjee
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have an applet -- 'checking' placed inside a folder called 'customer'.

And have placed the customer folder inside the jar file.

Both my check.html and the checking.jar are in the same location.

I am using the following in my applet tag but it doesn't work :

<APPLET CODE="customer.checking.class" codebase="." WIDTH=150 HEIGHT=150

archive="checking.jar"></APPLET>

I need the same to work through an application. Any help will be highly appreciated.

Thanks,
Paromita
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Paromitabanerjee Banerjee:

<APPLET CODE="customer.checking.class" codebase="." WIDTH=150 HEIGHT=150

archive="checking.jar"></APPLET>


Welcome to JavaRanch Paromita!

Check the seocnd example in this link.
 
paromitabanerjee mukerjibanerjee
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

Thanks for the help. But I know how to use a codebase.

I have tried giving different paths but the browser is unable to pick up the Applet.class which is inside a folder called customer in the jar file
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paromita, post package structure of your applet and <applet>.

I guess it is just a matter of giving proper package information in <applet>.
 
paromitabanerjee mukerjibanerjee
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The Checking.class is ina folder called 'Customer' inside the jar file.

The jar file and the html file are in the same location(i.e. same folder)

And the code for applet inside the html is :

<applet code="customer.checking" width="140" height="230" archive="check.jar"></applet>

While running the code, I am guessing its not able to find the jar file. Since the error that comes is 'ClassNotFoundError'.

There maybe some additional parameters that I should supply but I am not sure what....

Can anyone help ???

Thanks in advance.

Paromita
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chetan is asking you if the class is in a package named "customer", or if you've just placed in in a folder by that name. If it's the latter, I don't think there's any way to make it work. Either put the class into the "customer" package with a package statement, or put the checking applet at the top level of the jar file.
 
paromitabanerjee mukerjibanerjee
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The checking.class has a package statement -- called Customer.

But the jar is unable to find the class.

thanks,
Paromita
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. You've been going back and forth between "customer" and "Customer" and "checking" and "Checking". Although Windows doesn't care about the capitalization of file and directory names, Java classes and packages are case-sensitive, and the "applet" tag has to match what you used in the Java source file, exactly. Does that help?
 
paromitabanerjee mukerjibanerjee
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my mistake....

I have used all the names in lower case in my class and html file.

but while typing here Capital Letter has come in.

sorry about that.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic