Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Localizing JFileChooser (Without using UIManager)

843806Nov 2 2008 — edited Nov 2 2008
Hello,

I need to localize JFileChooser (in French and German) and my application is only targeted to run on JRE 1.6+.
I read the following (at [http://www.rgagnon.com/javadetails/java-0299.html] ):
Modern Swing release have now built-in ready-to-use translations for the JFileChooser.
 The language is choosen based on the current Locale. So you don't have to do anything to
 display the JFileChooser in the right language.
And I also got to know from the sun java swing forum
( at [http://forums.sun.com/thread.jspa?forumID=57&threadID=5121485] ) that :
The JFileChooser naturally is localized. You just need to ensure you have the internationalized jre.
If you mean to say you are running on an english OS and want it to display russian, then 
it is a little more work.You could try calling 

Locale.setDefault(<appropriate locale>);

The jre also may use the native file chooser, which makes things harder, in this case 
the setting of the locale may not work.
But no matter what I do I am not able to localize the JFileChooser.
Can any body tell me the correct procedure of doing this
(Well I know about the workaround i.e. doing it using the UIManager).
TIA and Regards,
Vivek
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 30 2008
Added on Nov 2 2008
3 comments
1,230 views