• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic