Search code examples
java-melwuit

set default locale in lwuit?


How to set default locale in lwuit(J2ME) and then how to change the default locale in lwuit? I'm using resource file for localization strings. Can any one give idea to solve this? Thanks in advance.


Solution

  • Ok I will try to solve your issue.

    To set a locale to yout LWUIT app you need to use Hashtable wich have your texts' values. Are you using the Resource Editor? It will be helpfull for you in this moment. In the Resource editor you can build a table, in several columns, that have all your values ​​in the various languages

    You must use the L10N values. You should catch them and use it like this:

    Hashtable h = res.getL10N("NameOfYourL10N", "languageColumName"); 
    UIManager.getInstance().setResourceBundle(h);