Hi,
I did a small test with the intention of changing the language online but I 
have not succeeded. What is the right way?
My code:

        res = UIManager.initFirstTheme("/theme");
        String idi = 
Display.getInstance().getLocalizationManager().getLanguage();
        Hashtable h = res.getL10N("L", "es");
        UIManager.getInstance().setResourceBundle(h);
        System.out.println(idi);
        Form hi = new Form("Hi World", BoxLayout.y());
        Label hola = new Label();
        hola.setText(UIManager.getInstance().localize("hola", "hola"));
        Button bt = new Button("Cambio Idioma a Ingles");
        bt.addActionListener((e) -> {
            UIManager.getInstance().setResourceBundle(res.getL10N("L", 
"en"));
        });
        hi.add(hola);
        hi.add(bt);
        hi.show();

<https://lh3.googleusercontent.com/-bIB3EjOcv38/WgcZ6InXTpI/AAAAAAAAAKs/sMPU3oPwLn8mZDjjwKrH_-FgD5ZLdeJMQCLcBGAs/s1600/prueba.PNG>






-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/98fb6c93-03d1-4c21-9f91-e9308308aeb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to