Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Set the preferred language:
    Edit->Preferences->Content->Languages
  2. Set the preferred encoding:
    View->Character Encoding->Japanese (Shift_JIS)

6. Running Java Swing apps in Japanese

Swing apps will not render East-asian or other non-latin character sets correctly unless you have setup the correct fonts in your JRE. Instead of having to modify font.properties files, you can use this simple workaround:

  1. cd to your jre/lib/fonts folder
  2. create a dir named "fallback" and cd into it (the JRE will look here before determining it cannot find a font)
  3. locate the system fonts you wish the JRE to know about. In Ubuntu 9.04 that location is /usr/share/fonts/truetype.
  4. create symlinks to those fonts in the fallback folder. For example ln -s /usr/share/fonts/truetype/ttf-japanese-mincho.ttf

References

http://www.linux.com/feature/53781
http://jody.sci.hokudai.ac.jp/~ike/colum/ubuntu_feisty_amd64.html
http://www.joelonsoftware.com/articles/Unicode.html
http://en.wikipedia.org/wiki/Shift-JIS