Problem description:
Java ProgramThe Chinese display in the swing/AWT component in is a box, while the title can display Chinese normally, and the system. Out. println ("Chinese string") can be used to display Chinese normally;
Solution:
It may be caused by the unsupported JRE Chinese font, so you can add a supported Chinese font.
Solution:
Step 1: Download the Chinese font. I use simsun. TTC, which can be found directly in Windows (My XP system is used). The input path is simsun under C: "Windows" fonts. TTC
You can also download the recommended Skynet website from the website:
Http://file.tianwang.com/cgi-bin/search? WORD = simsun. TTC
Step 2: Place simsun. TTC In the JRE Font Library as follows:
CD <java_home>/lib/fonts or CD <java_home>/JRE/lib/Fonts
Mkdir fallback (fallback indicates the folder for storing the backup LANGUAGE)
<Java_home> is the path to install JDK/JRE, and mine is/usr/lib/jdk1.5. Copy or link a Chinese font to it:
Ln-S/usr/share/fonts/TrueType/simsun. TTF/usr/lib/jdk1.5/JRE/lib/fonts/fallback/simsun. TTF