0

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?

Ahmad
  • 437
  • 5
  • 20

1 Answers1

0

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.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • I didn't use UIbuilder class anyway for some reason, so I can't use this method. all of my classes derived from "com.codenameone.ui.form". Is there any way to solve this problem? – Ahmad Dec 08 '12 at 11:48
  • Recreate your form. If you have hand coded createMyForm() method then just call it again and show that form without a transition. – Shai Almog Dec 12 '12 at 08:30
  • I did it as you said, I recreated form on back command. Thanks. – Ahmad Dec 12 '12 at 12:37