TITLE:JFileChooserにLocaleを設定する
#navi(../)
*JFileChooserにLocaleを設定する [#d5c5fe75]
>編集者:[[Terai Atsuhiro>terai]]~
作成日:2008-01-07~
更新日:&lastmod;

#contents

**概要 [#z80ce7f3]
JFileChooserにLocaleを設定して、タイトルやボタンの文字列を変更します。

#screenshot

**サンプルコード [#o0d6f00f]
#code{{
//JFileChooser.setDefaultLocale(Locale.ENGLISH);
fileChooser.setLocale((Locale)combo.getSelectedItem());
fileChooser.updateUI();
}}
-&jnlp;
-&jar;
-&zip;

**解説 [#h2e72623]
上記のサンプルでは、コンボボックスで指定したロケールをJFileChooserに設定してから開くようになっています。
タイトル、ボタンのラベルなどが、指定したロケールに変更されます。

- JDK 1.5.0_13 では、JVM のデフォルトが English 以外だった場合、Component#setLocale や、JComponent.setDefaultLocale を使っても反映されないようです。
-- [[Bug ID: 6606475 JComponent.setDefaultLocale(Locale.ENGLISH) useless if def locale is non-english>http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6606475]]
-- JDK 1.6.0 では問題無し

**参考リンク [#gbe40f72]
- [[Bug ID: 6606475 JComponent.setDefaultLocale(Locale.ENGLISH) useless if def locale is non-english>http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6606475]]

**コメント [#h2cbdcae]
#comment