This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Chinese text not displaying in JFileChooser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Chinese text not displaying in JFileChooser" Watch "Chinese text not displaying in JFileChooser" New topic
Author

Chinese text not displaying in JFileChooser

Jared Cope
Ranch Hand

Joined: Aug 18, 2004
Posts: 243
Hi,

When my Java application is run on a native chinese windows XP machine, the JfileChooser shows box characters anywhere that chinese characters appear. This includes the file names that you can choose, as well as the labels for buttons and fields.

I know that this is due to an incorrect font being used in the JFileChooser for displaying text, however using the .setFont() method on the JFileChooser with a good chinese font has had no effect. Any ideas?

Cheers, Jared.


SCJP 1.4 91%, SCJP 1.5 88%, SCJD B&S
Jared Cope
Ranch Hand

Joined: Aug 18, 2004
Posts: 243
Hi,

Okay, this was actually due to using the JGoodies looks jar (version 1.2.2.jar) to set the global look and feel for the application. Appears that chinese characters aren't supported very well in that.

However, their latest version 2.0.1.jar has fixed it and works fine with chinese characters.

Cheers, Jared.
Zhongbo Li
Greenhorn

Joined: Dec 06, 2003
Posts: 23
打开文件对话框时,把显示风格设置为本地的风格,直接使用 Windows 的文件对话框,是一个很不错的办法。


SCJP,SCJD,软件设计师<br />Skype:mediumwave<br />QQ:85646604<br /><a href="http://www.yjping.com" target="_blank" rel="nofollow">http://www.yjping.com</a>
 
 
subject: Chinese text not displaying in JFileChooser
 
Similar Threads
How to write single byte and double byte characters on pdf using java api(iText)
How to display Chinese in TextArea
Multilingual JSP Problem
Internationalization query
setting utf-8 in jsp