Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2007

Tip: Looking for answers? Try searching our database.

Properties files in Applet

Thread view: 
Willy Johnsson - 18 Oct 2007 20:02 GMT
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/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.