Search code examples
internationalizationlwuitcodenameone

lwuit change language and apply it


I have a form to change language of my j2me application. This application is created by codenameone.

I create a class and I write all my words into it in 2 language English and Farsi. I change the language with this code:

UIManager.getInstance().setResourceBundle(new CommonSettings().getFarsi());

How can I apply this language to all components of this form lively or without exit from this form?


Solution

  • You need to recreate the form. The GUI builder can do this automatically for you if you invoke the method reloadForm() in the state machine.