Hello,
I would to my Applet support couple of dirrerent languages.
I tested standard porperties file that were included in applet's jar file
but didn't get it work.
Is it possible to package properties files to applet jar?
If yes how to call them?
Cheers!
Arne Vajhøj - 19 Oct 2007 00:15 GMT
> I would to my Applet support couple of dirrerent languages.
> I tested standard porperties file that were included in applet's jar file
> but didn't get it work.
>
> Is it possible to package properties files to applet jar?
> If yes how to call them?
Sure.
Something like:
Properties p = new Properties();
p.load(getClass().getClassLoader().getRessourceAsStream("path in jar");
Arne
PS: Shouldn't you use the special form of properties files known
as message bundles for this ?
Andrew Thompson - 19 Oct 2007 01:23 GMT
....
>I would to my Applet support couple of dirrerent languages.
Web start can deliver resources to applets and applications
according the the local PC and its settings (language etc.).
>I tested standard porperties file that were included in applet's jar file
>but didn't get it work.
>
>Is it possible to package properties files to applet jar?
Yes.
>If yes how to call them?
URL propertyLocation = this.
getClass().getResource("/path/to/app.properties");
System.out.println("propertyLocation: " + propertyLocation);
InputStream propertyStream = propertyLocation.openStream();

Signature
Andrew Thompson
http://www.athompson.info/andrew/
Roedy Green - 19 Oct 2007 11:31 GMT
On Thu, 18 Oct 2007 22:04:59 +0300, "Willy Johnsson"
<willy.j.0@hotmail.com> wrote, quoted or indirectly quoted someone who
said :
>I would to my Applet support couple of dirrerent languages.
>I tested standard porperties file that were included in applet's jar file
>but didn't get it work.
see http://mindprod.com/jgloss/resource.html
For an example of use, see the holiday calculator which loads a text
list of holidays it supports or the In words calculator which loads a
list of languages it supports.
See http://mindprod.com/products1.html#HOLIDAYS
http://mindprod.com/products1.html#INWORDS
For customising an app to a particular language see
http://mindprod.com/jgloss/internationalisation.html
and chase the links.
Sun has special tools for customising a big app to different locales
and automatically selecting the correct customisations.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Andrew Thompson - 19 Oct 2007 13:51 GMT
...
>Sun has special tools for customising a big app to different locales ..
'locales' (slaps forehead) I should have thought to mention
that as a 'search term' - also 'internationalization'.
But then.. I am guessing the mindprod pages mention most
of the key terms, and have plenty of links back to relevant
resources.

Signature
Andrew Thompson
http://www.athompson.info/andrew/