0 Replies Latest reply: Oct 19, 2011 9:15 PM by 895254 RSS

    JApplet won't display chinese character properly until browser reloads

    895254
      Hi everyone,

      I have developed a JApplet (with JDeveloper 11g R1, Java 1.6.0_018) to display chinese characters. The problem is, some components, JLabel especially, won't display the proper chinese chars until the web-browser (both IE and Chrome, jre 1.6.0_026) is reloaded. Once reloaded, everything seems to display properly.

      I tested the same JApplet as a standalone apps and there isn't such a problem. The chinese chars got displayed straight away.

      I actually added the below into the JApplet's html file:
      <param name="java_arguments" value="-Duser.language=zh -Duser.region=CN">

      This param is put in place because in the future, other languages will be supported via the same method.


      I have also added the below in my source code where m_locate=new Locale("zh", "CN"):
      System.setProperty("user.language", m_locale.getLanguage());
      System.setProperty("user.country", m_locale.getCountry());

      Just to find out why JLabels are not displaying chinese chars for the first time, I did a System.out of one of the JLabel's locale. When the JApplet is first initialized and loaded, I got the below:

      m_lblTXClientCode.locale: en_US

      Without doing anything, just simply reloading the page again, I got the below instead:

      m_lblTXClientCode.locale: zh_CN

      Can anyone shed some light here?

      Thank you for your time.

      Edited by: 892251 on Oct 19, 2011 7:14 PM