Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Properties files in Applet

Reply
Thread Tools

Properties files in Applet

 
 
Willy Johnsson
Guest
Posts: n/a
 
      10-18-2007
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!


 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?Arne_Vajh=F8j?=
Guest
Posts: n/a
 
      10-18-2007
Willy Johnsson wrote:
> 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().getRessourceAsS tream("path in jar");

Arne

PS: Shouldn't you use the special form of properties files known
as message bundles for this ?
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      10-19-2007
Willy Johnsson wrote:
....
>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();

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

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.asp...neral/200710/1

 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      10-19-2007
On Thu, 18 Oct 2007 22:04:59 +0300, "Willy Johnsson"
<(E-Mail Removed)> 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.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      10-19-2007
Roedy Green wrote:
...
>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.

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

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.asp...neral/200710/1

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
struts/jsp/applet: sessionid doesn't work in applet for macs only Blah Blah Java 0 08-13-2003 02:51 AM
Cool Applet Cool Applet http://24.60.235.213/Grid/ Alisher Fatykhov Java 1 08-06-2003 04:32 AM
Re: newbie: Join JApplet & Applet in one applet Andrew Thompson Java 0 08-05-2003 01:41 PM
Re: play wave files using java.applet.Applet webster Java 0 07-20-2003 01:51 PM
applet vs. canvas in applet Rob Love Java 1 07-07-2003 10:07 PM



Advertisments